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 works fine when everything is displayed in one row. But if I switch to multirow all of the three columns in the first column (C1, C4 and C6) will receive the combobox. This is wrong. I have tried to check the MappingName of the cells with string strColumnName = this.gridDataBoundGrid1.Binder.InternalColumns[e.ColIndex].MappingName; but this does not help
My current workaround checkeds if MultiRow is enabled and counts the row so that only every third row gets the combobox (e.RowIndex % 3 == 0). But I would prefer a solution which depends on the underlying fieldname or dataname or anything other unique and reliable property.
ADAdministrator Syncfusion Team March 22, 2007 04:48 PM UTC
Hi Alex,
Here is a code snippet that shows you "How to get the mapping name of the required column in a GridDataBoundGrid if the colindex and its rowIndex is given?".
public string GetMappingName(GridDataBoundGrid grid,int RowIndex, int ColIndex ) { GridBoundRecordState rs = grid.Binder.GetRecordStateAtRowIndex(RowIndex);
int MultiRecordRowCount = rs.RowIndexInRecord; int iColCount = grid.Model.ColCount; int index = ( rs.RowIndexInRecord * iColCount ) + ColIndex + rs.RowIndexInRecord;
ADAdministrator Syncfusion Team March 22, 2007 05:41 PM UTC
Hi Alex,
Please ignore by previous post. You can use the GridHierarchyLevel.RowFieldToField method to calculates a zero-based field number that can be used as an index in the InternalColumns based on the zero-based row index in the record and the zero-based field column in the grid. Please try this code snippet and let me know if this helps.
public string GetMappingName(GridModelDataBinder binder,int RowIndex, int ColIndex) { GridBoundRecordState rs = binder.GetRecordStateAtRowIndex(RowIndex); GridHierarchyLevel level = gridDataBoundGrid1.Binder.GetHierarchyLevel(rs.LevelIndex);
int field = binder.ColIndexToField(ColIndex); int rowfield = level.RowFieldToField( rs.RowIndexInRecord, field );