DataGrid row height

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

I've looked at a couple of posts about this and Alex's DataGrid Demo, but I
still don't see how to change row height programatically so that long text
will wrap to the next line in a DataGrid. Has anyone been able to do this?
(preferrably in VB)
 
Thanks. I used the C# -> VB converter online to convert SetGridRowHeight
to:

Public Sub SetGridRowHeight(dg As DataGrid, nRow As Integer, cy As Integer)
Dim arrRows As ArrayList = CType(dg.GetType().GetField("m_rlrow",
BindingFlags.NonPublic Or BindingFlags.Static Or
BindingFlags.Instance).GetValue(dg), ArrayList)
Dim row As Object = arrRows(nRow)
row.GetType().GetField("m_cy", BindingFlags.NonPublic Or
BindingFlags.Static Or BindingFlags.Instance).SetValue(row, cy)
End Sub 'SetGridRowHeight

but GetValue(dg) is returning Nothing.

Has anyone gotten this to work in VB?
 
Perhaps you are trying to invoke this function before you have populated the
grid.
Otherwise you shoud use the SetDefaultGridRowHeight function instead.
 
Back
Top