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 am using the following code to highlight the "current" row in the grid:
GridControlBase grid = SelectionGrid;
GridCurrentCell cc = SelectionGrid.CurrentCell;
if ( e.RowIndex > grid.Model.Rows.HeaderCount && e.ColIndex > grid.Model.Cols.HeaderCount && cc.HasCurrentCellAt( e.RowIndex )) {
e.Style.Font.Bold = true;
e.Style.BackColor = Color.LightSkyBlue;
// e.Style.BackColor = Color.FromKnownColor( System.Drawing.KnownColor.Highlight);
}
I have two issues: 1) I would like to use the System's Highlight color for the back color and Highlight and ForeColor to Highlight Text, but can't figure out how to change the text color and 2) when the user clicks on a cell, that cell's back color is different. How do I get it to look the same as the rest of the row?
I guess in general, is there a better way to implement a "row select" looking mode?
Jeff
ADAdministrator Syncfusion Team November 17, 2003 04:38 PM UTC
To change the text color, use the e.Style.TextColor property.
If you do not want the currentcell to be editable, then the simplest way to make sure it is the same color as the rest of the row is to handle the CurrentCellActivating event, and in the handler set e.ColIndex = 0.
If you want the cell to be editable and show some same colors as the rest of the row, it is possible, but requires a little more work handling PrepareViewStyleInfo and specifically checking for the current cell.
JBJeff Block November 18, 2003 08:21 AM UTC
Perfect on both counts! Non-editable is the desired behavior. Thanks.
Jeff