Posted on 2005-03-28
I was recently using reflection to access method get_DataGridRows from a System DataGrid like this:
MethodInfo mi = dg1.GetType().GetMethod("get_DataGridRows",
BindingFlags.FlattenHierarchy | BindingFlags.IgnoreCase | BindingFlags.Instance
| BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static);
System.Array dgra = (System.Array)mi.Invoke(dg1,null);
Now I have created a custom datagrid control that inherits from System DataGrid. Now every time I try to execute the previous code, I get a null reference error. The problem is that I cannot get a MethodInfo object from a type of my custom datagrid. How would I accomplish this with my own custom datagrid?????