Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / April 2005

Tip: Looking for answers? Try searching our database.

Reflection

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Magesh - 20 Apr 2005 21:17 GMT
Hi,

In order to display multiple lines in a column, i am creating creating a new
column style deriving from the DataGridTextBoxColumn.  To get the height of
each row i am using the following code in one of the methods of this custom
columnstyle class.

MethodInfo mi = t.GetMethod("get_DataGridRows",BindingFlags.FlattenHierarchy
| BindingFlags.IgnoreCase | BindingFlags.Instance | BindingFlags.NonPublic |
BindingFlags.Public | BindingFlags.Static);
DataGrid dg = this.DataGridTableStyle.DataGrid;
Array dgRowArray = (Array)(mi.Invoke(dg,null));
Heights = new ArrayList();
foreach (object dgRowHeight in dgRowArray)
      {
      if (dgRowHeight.ToString().EndsWith("DataGridRelationshipRow") == true)
    {
        Heights.Add(dgRowHeight);
    }
      }

The above code works perfectly if use this column style in
System.Windows.Forms.DataGrid control.  

I am also creating a custom datagrid deriving from the
System.Windows.Forms.DataGrid class .

If i use the above code in the custom DataGrid class, the

MethodInfo mi = t.GetMethod("get_DataGridRows",BindingFlags.FlattenHierarchy
| BindingFlags.IgnoreCase | BindingFlags.Instance | BindingFlags.NonPublic |
BindingFlags.Public | BindingFlags.Static);

statement returns null.  Is it not possible to obtain the method information
of a base class??

Thanks for the help.

Magesh
Marvin Varela - 20 Apr 2005 22:11 GMT
Yes it is

MethodInfo mi =
t.BaseType.GetMethod("get_DataGridRows",BindingFlags.FlattenHierarchy
| BindingFlags.IgnoreCase | BindingFlags.Instance | BindingFlags.NonPublic

BindingFlags.Public | BindingFlags.Static);

this should return what you need.

> Hi,
>
[quoted text clipped - 37 lines]
>
> Magesh
Magesh - 21 Apr 2005 11:24 GMT
Thanks a lot Marvin.

Magesh

> Yes it is
>
[quoted text clipped - 54 lines]
> >
> > Magesh

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.