J
John Richardson
I haven't played much with Reflection before, so I'm hoping I'm missing
something simple with this problem I'm having.
Trying to follow the online examples for resizing a DataGrid row height, and
the following is the snippet:
------
MethodInfo mi = dataGrid.GetType().GetMethod( "get_DataGridRows",
BindingFlags.FlattenHierarchy |
BindingFlags.IgnoreCase |
BindingFlags.Instance |
BindingFlags.NonPublic |
BindingFlags.Public |
BindingFlags.Static );
Array dataGridArray = (Array) mi.Invoke( dataGrid, null );
------
But, my dataGrid in this case is an overridden System.Windows.Forms.DataGrid
class, and GetMethod does not find my "get_DataGridRows" for my inherrited
class. mi is null for the above execution. I've tried seeing if I can cast
the type to the lower one, but I must be too tired to figure it out, so
hopefully someone here can assist me.
Thanks.
something simple with this problem I'm having.
Trying to follow the online examples for resizing a DataGrid row height, and
the following is the snippet:
------
MethodInfo mi = dataGrid.GetType().GetMethod( "get_DataGridRows",
BindingFlags.FlattenHierarchy |
BindingFlags.IgnoreCase |
BindingFlags.Instance |
BindingFlags.NonPublic |
BindingFlags.Public |
BindingFlags.Static );
Array dataGridArray = (Array) mi.Invoke( dataGrid, null );
------
But, my dataGrid in this case is an overridden System.Windows.Forms.DataGrid
class, and GetMethod does not find my "get_DataGridRows" for my inherrited
class. mi is null for the above execution. I've tried seeing if I can cast
the type to the lower one, but I must be too tired to figure it out, so
hopefully someone here can assist me.
Thanks.