Click here to Skip to main content
15,888,461 members
Home / Discussions / C#
   

C#

 
AnswerRe: Method GetHashCode ....some question. Pin
stancrm3-Jul-06 20:05
stancrm3-Jul-06 20:05 
GeneralRe: Method GetHashCode ....some question. Pin
Yanshof3-Jul-06 20:27
Yanshof3-Jul-06 20:27 
GeneralRe: Method GetHashCode ....some question. Pin
stancrm3-Jul-06 20:55
stancrm3-Jul-06 20:55 
AnswerRe: Method GetHashCode ....some question. Pin
mav.northwind4-Jul-06 0:17
mav.northwind4-Jul-06 0:17 
QuestionTab Control Pin
satsumatable3-Jul-06 19:01
satsumatable3-Jul-06 19:01 
AnswerRe: Tab Control Pin
Shajeel3-Jul-06 19:15
Shajeel3-Jul-06 19:15 
GeneralRe: Tab Control Pin
satsumatable3-Jul-06 19:17
satsumatable3-Jul-06 19:17 
QuestionInvoke Private method of inherited class Pin
Kais4U3-Jul-06 18:56
Kais4U3-Jul-06 18:56 
Hi,

I have created a custom grid class which inherits from the DataGrid class.
Using reflection i want to invoke on of the private method of the base class. Am able to list all the public method, but not able to get the refernce to the private methods. Attached is the class am using.

<br />
	public class CustomDataGridTest : DataGrid <br />
	{<br />
		<br />
	<br />
		private DataTable PopulateTable()<br />
		{<br />
			DataTable dt = new DataTable();<br />
			dt.Columns.Add("Name");<br />
			dt.Rows.Add(new object[] {"John"});<br />
			dt.Rows.Add(new object[] {"Miller"});<br />
			dt.Rows.Add(new object[] {"Lara"});<br />
			dt.Rows.Add(new object[] {"Tommy"});<br />
			dt.Rows.Add(new object[] {"Robin"});<br />
			return dt;<br />
		}<br />
<br />
		public MethodInfo GetMethodInfo()<br />
		{<br />
			this.DataSource = PopulateTable();<br />
<br />
			MethodInfo mi = base.GetType().GetMethod("get_DataGridRows",  <br />
				BindingFlags.FlattenHierarchy | BindingFlags.IgnoreCase | BindingFlags.Instance  <br />
				| BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static); <br />
			return mi;<br />
		}<br />
	}<br />


Can anyone tell me as why the GetType().GetMethod() not returning the methodinfo object. It always return null.

Thanks in advance for any kind of help



Regards,
Kais
AnswerRe: Invoke Private method of inherited class Pin
Igor Sukhov3-Jul-06 19:50
Igor Sukhov3-Jul-06 19:50 
GeneralRe: Invoke Private method of inherited class Pin
Kais4U3-Jul-06 20:41
Kais4U3-Jul-06 20:41 
GeneralRe: Invoke Private method of inherited class Pin
Igor Sukhov4-Jul-06 2:36
Igor Sukhov4-Jul-06 2:36 
GeneralRe: Invoke Private method of inherited class Pin
Kais4U4-Jul-06 18:27
Kais4U4-Jul-06 18:27 
GeneralRe: Invoke Private method of inherited class Pin
Igor Sukhov5-Jul-06 6:48
Igor Sukhov5-Jul-06 6:48 
QuestionWindow Handles outside application Pin
Sunitha19833-Jul-06 17:40
Sunitha19833-Jul-06 17:40 
AnswerRe: Window Handles outside application Pin
stancrm3-Jul-06 20:12
stancrm3-Jul-06 20:12 
QuestionUsing Resource files .NET 2.0 Pin
WebMaster3-Jul-06 12:57
WebMaster3-Jul-06 12:57 
AnswerRe: Using Resource files .NET 2.0 Pin
Nader Elshehabi3-Jul-06 14:55
Nader Elshehabi3-Jul-06 14:55 
QuestionProblem with C# asp.net 2.0 TreeView [modified] Pin
WebMaster3-Jul-06 11:04
WebMaster3-Jul-06 11:04 
QuestionReuse Code Pin
picasso23-Jul-06 10:54
picasso23-Jul-06 10:54 
AnswerRe: Reuse Code Pin
Colin Angus Mackay3-Jul-06 13:10
Colin Angus Mackay3-Jul-06 13:10 
QuestionAssistance with converting application to library Pin
b_girl3-Jul-06 9:52
b_girl3-Jul-06 9:52 
AnswerRe: Assistance with converting application to library Pin
BoneSoft3-Jul-06 10:12
BoneSoft3-Jul-06 10:12 
AnswerRe: Assistance with converting application to library Pin
arow69d3-Jul-06 16:46
arow69d3-Jul-06 16:46 
GeneralRe: Assistance with converting application to library Pin
b_girl3-Jul-06 17:10
b_girl3-Jul-06 17:10 
GeneralRe: Assistance with converting application to library Pin
b_girl6-Jul-06 9:47
b_girl6-Jul-06 9:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.