The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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
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
>
>
>