|
Home > Archive > MS SQLCE > June 2005 > Row height in datagrid
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Row height in datagrid
|
|
| Philip Germanos 2005-06-17, 8:24 pm |
| 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 _setGridDefaultRowHe
ight(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[] {});
}
| |
| Philip Germanos 2005-06-17, 8:24 pm |
| Its okay, i got it.
Thanks guys.
"Philip Germanos" wrote:
> 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 _setGridDefaultRowHe
ight(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[] {});
> }
>
|
|
|
|
|