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've used the GridGroupingControl grid and added a list of objects to the DataSource. All ok, the data is shown. Now i want to disable certain rows in the grid.
How can I do that? How can I access the row and set it to disable?
RCRajadurai C Syncfusion Team May 22, 2009 09:05 AM UTC
Hi Michael,
Thanks for your interest in Syncfusion products.
If your intention is to disable certain rows in grid, then please try the following code in handled in QueryCellStyleInfo event. void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e) { if (e.TableCellIdentity.TableCellType == Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellType.RecordFieldCell || e.TableCellIdentity.TableCellType == Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellType.AlternateRecordFieldCell) { if (e.TableCellIdentity.ColIndex > 0) { Element el = e.TableCellIdentity.DisplayElement; Record r = el.GetRecord(); if (r != null) { int row = e.TableCellIdentity.Table.UnsortedRecords.IndexOf(r); if (row == 7) e.Style.Enabled = false; } } } }
This checks for record at index 7 and disables it.
Regards, Rajadurai
MEMichael EgloffMay 25, 2009 10:47 AM UTC
Hej Rajadurai, that's exactly what is was looking for!