Re: row height in datagrid
- From: Philip Germanos <PhilipGermanos@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 17 Jun 2005 16:08:02 -0700
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.
>
>
>
.
- References:
- row height in datagrid
- From: Philip Germanos
- Re: row height in datagrid
- From: Frank Hickman [MVP]
- row height in datagrid
- Prev by Date: Scroll bar in datagrid
- Next by Date: RE: Driving Excel from a DataSet
- Previous by thread: Re: row height in datagrid
- Next by thread: Driving Excel from a DataSet
- Index(es):
Relevant Pages
|
|