PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
How to force the Scrollbar in DataGridView
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
How to force the Scrollbar in DataGridView
![]() |
How to force the Scrollbar in DataGridView |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hello NG,
I'm using the following method to modify the High o Datagrid-Rows void SetGridRowHeight(DataGrid dg, int rowNumber, int cy) { BindingFlags bf = BindingFlags.NonPublic | BindingFlags.Instance; ArrayList rows = (ArrayList)dg.GetType().GetField("m_rlrow", bf).GetValue(dg); object row = rows[rowNumber]; row.GetType().GetField("m_cy", bf).SetValue(row, cy); dg.Invalidate(); } But now I've to force the Scrollbar manualy becaus it don't comes up automatic when the sum of all RowHighs is greather then the DatagridHigh. best regards René ps: I Know my english isn't the best. But i hope you can understand the problem. otherwhise ask for more details. Thanks |
|
|
|
#2 |
|
Guest
Posts: n/a
|
You can show the scrollbar like this:
ScrollBar sb = (ScrollBar)typeof(DataGrid).GetField("m_sbVert", BindingFlags.NonPublic|BindingFlags.GetField|BindingFlags.Instance).GetValue(dg); sb.Visible = true; "Rene.Scharf" <nospam@nowhere.com> wrote in message news:u9fOtHJtHHA.4916@TK2MSFTNGP04.phx.gbl... > Hello NG, > > I'm using the following method to modify the High o Datagrid-Rows > > void SetGridRowHeight(DataGrid dg, int rowNumber, int cy) > { > BindingFlags bf = BindingFlags.NonPublic | BindingFlags.Instance; > ArrayList rows = (ArrayList)dg.GetType().GetField("m_rlrow", > bf).GetValue(dg); > object row = rows[rowNumber]; > row.GetType().GetField("m_cy", bf).SetValue(row, cy); > dg.Invalidate(); > } > > But now I've to force the Scrollbar manualy becaus it don't comes up > automatic when the sum of all RowHighs is greather then the DatagridHigh. > > best regards > René > > ps: I Know my english isn't the best. But i hope you can understand the > problem. otherwhise ask for more details. Thanks > > > > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

