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.
In GridGroupingControl, I want to highlight the whole current row when click on a cell.
I use following code in DataBoundGrid''s click event to highlight current row.
_grid.Selections.Clear();
_grid.Selections.SelectRange(GridRangeInfo.Row(currentRowIndex),true);
_grid.Refresh();
TIA
ADAdministrator Syncfusion Team September 7, 2004 11:43 AM UTC
Hi,
instead of SelectRange you can handle TableControlPrepareViewStyleInfo.
Example:
this.gridGroupingControl1.TableControlPrepareViewStyleInfo += new GridTableControlPrepareViewStyleInfoEventHandler(gridGroupingControl1_TableControlPrepareViewStyleInfo);
private void gridGroupingControl1_TableControlPrepareViewStyleInfo(object sender, GridTableControlPrepareViewStyleInfoEventArgs e)
{
GridTableCellStyleInfo style = (GridTableCellStyleInfo) e.Inner.Style;
if (style.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell
|| style.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell)
{
Record r = style.TableCellIdentity.DisplayElement.ParentRecord;
if (r.IsCurrent)
{
e.Inner.Style.BackColor = SystemColors.Highlight;
e.Inner.Style.TextColor = SystemColors.HighlightText;
}
}
}
Stefan
SSSimon SpruzenSeptember 9, 2004 06:39 AM UTC
Or just set:
gridControl.ListBoxSelectionMode = System.Windows.Forms.SelectionMode.One;
and make sure gridControl.AllowSelection has AlphaBlend option checked for a nicer visual look.