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.
Hi,
I have a DataGrid bound to a table with 5 columns and 20 rows. Out of 5 columns, the first one is of custom type
public class DataGridCheckBoxColumn : DataGridBoolColumn {}; the rest 4 columns are of type DataGridTextBoxColumn.
My first column needs to be able to hide checkboxes based on the rowNum. I was able to make them uneditable by overriding the Edit()method, but how do I make them invisible? I tried overriding Paint() method, but it didn't work for me:
protected override void Paint(Graphics g, Rectangle bounds, CurrencyManager source, int rowNum, bool alignToRight)
{
if (rowNum == 1)
{
Brush bgBrush = new SolidBrush(this.DataGridTableStyle.BackColor);
Brush fgBrush = new SolidBrush(this.DataGridTableStyle.ForeColor);
g.FillRectangle (bgBrush, bounds);
}
else
base.Paint(g, bounds, source, rowNum, alignToRight);
}
I would appreciate any suggestions on how I might be able to hide/make invisible certain checkboxes.
Thanks so much!
Natalia