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.
Here is what I wound up with. I think it is a simpler approach.
public class SingleClickDataGrid : DataGrid
{
public SingleClickDataGrid()
{
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.GridMouseDown);
}
public void GridMouseDown(object sender, MouseEventArgs e)
{
System.Windows.Forms.DataGrid.HitTestInfo hi;
// let's see where we clicked...
hi = HitTest(e.X,e.Y);
// If the user did not click on a cell, we don't care...
// we'll just pass on to the base class
if(hi.Type == System.Windows.Forms.DataGrid.HitTestType.Cell)
{
// Get the TableStyles collection
DataGridTableStyle dgt = TableStyles[0];
// Get the ColumnStyle for the selected column
DataGridColumnStyle myCol = dgt.GridColumnStyles[hi.Column];
// Is this a check box column?
// if not, we'll let the base class handle it
if(myCol.GetType() == typeof(DataGridBoolColumn))
{
// First part of the magic... select the row, so that the edit can happen
Select(hi.Row);
// Call the grid table style to start and end the edit
dgt.BeginEdit(myCol,hi.Row);
dgt.EndEdit(myCol,hi.Row,true);
}
}
}
}