Re: row height in datagrid



Thx Frank,

I got it.

"Frank Hickman [MVP]" wrote:

> "Philip Germanos" <PhilipGermanos@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
> message news:A58172DD-AF29-4157-B1CF-AB3BAAFB3E1F@xxxxxxxxxxxxxxxx
> > Hello,
> >
> > If i execute the code below, i change the row height of my datagrid to be
> > able to display datatable1. But then i want to display datatable2 in the
> > datagrid using the default row heights.
> > How do i switch back to the default datagrid row heights?
> >
> > thank you.
> >
> > Code:
> >
> > cy is the row height in pixels you desire:
> >
> > private void _setGridDefaultRowHeight(DataGrid dg, int cy)
> > {
> > FieldInfo fi = dg.GetType().GetField("m_cyRow",
> > BindingFlags.NonPublic |
> > BindingFlags.Static |
> > BindingFlags.Instance);
> >
> > fi.SetValue(dg, cy);
> >
> > dg.GetType().GetMethod("_DataRebind",
> > BindingFlags.NonPublic |
> > BindingFlags.Static |
> > BindingFlags.Instance).Invoke(dg, new object[] {});
> > }
> >
>
> Why not retrieve the default row height after the creation of the grid and
> store it in a member variable then you can reset it as you like.
>
> --
> ============
> Frank Hickman
> Microsoft MVP
> NobleSoft, Inc.
> ============
> Replace the _nosp@m_ with @ to reply.
>
>
>
.



Relevant Pages

  • Re: Row height in a datagrid
    ... >I have messed with trying to set the row heights and found it can be done ... There is a private property in the DataGrid which you have to ...
    (microsoft.public.dotnet.languages.vb)
  • RE: Row height in datagrid
    ... > If i execute the code below, i change the row height of my datagrid to be ... > able to display datatable1. ... > datagrid using the default row heights. ...
    (microsoft.public.dotnet.framework.adonet)
  • row height in datagrid
    ... If i execute the code below, i change the row height of my datagrid to be ... able to display datatable1. ... How do i switch back to the default datagrid row heights? ...
    (microsoft.public.data.ado)
  • Row height in datagrid
    ... If i execute the code below, i change the row height of my datagrid to be ... able to display datatable1. ... How do i switch back to the default datagrid row heights? ...
    (microsoft.public.dotnet.framework.adonet)
  • Row height in datagrid
    ... If i execute the code below, i change the row height of my datagrid to be ... able to display datatable1. ... How do i switch back to the default datagrid row heights? ...
    (microsoft.public.sqlserver.ce)