G
Guest
Some weeks ago, I needed to access the method "get_DataGridRows" from the System.Windows.Forms.DataGrid class.
I successfully worked it out with the following call:
MethodInfo mi = DataGridInstance.GetType().GetMethod("get_DataGridRows", BindingFlags.FlattenHierarchy | BindingFlags.IgnoreCase | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static);
I've now created a class called "MyDataGrid" that inherits from the System.Windows.Forms.DataGrid class.
My problem is that the previous code does not work any more for MyDataGrid instances: it always returns an <undefined value>.
I suppose that's because I am trying to access a method that is not available in the inherited class. So I tryed with this call: base.GetType().GetMethod().... inside the inherited class, but I got an <undefined value> again.
Any ideas?
TIA
m|3
I successfully worked it out with the following call:
MethodInfo mi = DataGridInstance.GetType().GetMethod("get_DataGridRows", BindingFlags.FlattenHierarchy | BindingFlags.IgnoreCase | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static);
I've now created a class called "MyDataGrid" that inherits from the System.Windows.Forms.DataGrid class.
My problem is that the previous code does not work any more for MyDataGrid instances: it always returns an <undefined value>.
I suppose that's because I am trying to access a method that is not available in the inherited class. So I tryed with this call: base.GetType().GetMethod().... inside the inherited class, but I got an <undefined value> again.
Any ideas?
TIA
m|3