We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

autosize the rowheights for a derived datagrid?

Thread ID:

Created:

Updated:

Platform:

Replies:

15138 Jun 11,2004 12:42 PM UTC Jun 11,2004 01:24 PM UTC WinForms 1
loading
Tags: FAQ
Manish
Asked On June 11, 2004 12:42 PM UTC

This question relates to WINDOWS FAQ QUESTION IN DataGrid control seciton How can I autosize the rowheights in my datagrid? while the code there works perfectely with the Datagrid control from System.Windows.Forms.DataGrid class , It does not wrok with the derived grid class, which inherits from datagrid class. What happens is this: In the next lines, cdgDataGrid refers to a System.Windows.Forms.DataGrid inherited control: objMethodInfo = cdgDataGrid.GetType().GetMethod( "get_DataGridRows", BindingFlags.FlattenHierarchy | BindingFlags.IgnoreCase | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static); The problem is, that it works fine when this code works over the control, but fails on the same call to the inherited control: as soon as I try to build a control based on this code, the variable objMethodInfo remains empty after this call. Any clue as to why this is happening

Manish
Replied On June 11, 2004 01:24 PM UTC

And also what is the solution. One of the solutions mentioned in another post to use datagrid's GetCellBounds(row,col).height method without reflection does not seem to wrok for me. Has anybody soluiton to this ? > This question relates to WINDOWS FAQ QUESTION IN DataGrid control seciton > > How can I autosize the rowheights in my datagrid? > > while the code there works perfectely with the Datagrid control from System.Windows.Forms.DataGrid class , It does not wrok with the derived grid class, which inherits from datagrid class. > > What happens is this: > > In the next lines, cdgDataGrid refers to a System.Windows.Forms.DataGrid inherited control: > > objMethodInfo = cdgDataGrid.GetType().GetMethod( "get_DataGridRows", > BindingFlags.FlattenHierarchy | BindingFlags.IgnoreCase | BindingFlags.Instance > | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static); > > The problem is, that it works fine when this code works over the control, but fails on the same call to the inherited control: as soon as I try to build a control based on this code, the variable objMethodInfo remains empty after this call. > > Any clue as to why this is happening > > >

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;