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.
I was using ColIndexToField before in my code that determines the field under the current cell.
Now I started using LayoutColumns method to make a long record span several lines.
ColIndexToField is no use anymore, because it does not take RowIndex as a parameter, and thus cannot give me the proper Field name.
Please advice, how do I figure out the Field name from an event, such as CurrentCellValidated or QueryCellInfo, when the only thing that is available to me is RowIndex and ColIndex.
Thanks.
ADAdministrator Syncfusion Team September 20, 2004 07:19 PM
Hi Jeck,
I think the following code should do it:
GridBoundRecordState state = binder.GetRecordStateAtRowIndex(e.RowIndex);
GridHierarchyLevel level = binder.GetHierarchyLevel(state.LevelIndex);
fieldNum = level.RowFieldToField(state.row, fieldNum);
GridBoundColumnsCollection columns = level.InternalColumns;
if (fieldNum >= 0 && fieldNum < columns.Count)
{
GridBoundColumn columnStyle = columns[fieldNum];
}
Stefan
ADAdministrator Syncfusion Team September 21, 2004 12:18 PM
Thanks! Works great!
I think this is a nice topic for Knowledge Base. Few other people at our company were puzzled too.
>Hi Jeck,
>
>I think the following code should do it:
>
>
>GridBoundRecordState state = binder.GetRecordStateAtRowIndex(e.RowIndex);
>GridHierarchyLevel level = binder.GetHierarchyLevel(state.LevelIndex);
>fieldNum = level.RowFieldToField(state.row, fieldNum);
>GridBoundColumnsCollection columns = level.InternalColumns;
>if (fieldNum >= 0 && fieldNum < columns.Count)
>{
> GridBoundColumn columnStyle = columns[fieldNum];
>}
>
>
>Stefan
>
>