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 GridDataBoundGrid control on a current project of mine. By default, the first column on the control (column 0) shows a little black triangle pointing to the row, when a row receives focus. I would like to change this.
Currently on my grid control, I have a ContextMenu on (column 0) for each row that is loaded. The ContextMenu is working just fine, however there is no indication to the user that is is there. I would like to put my own text on the row header (column 0) to let the user know they can click the row header to get more options, however all my attempts to do this are failing.
I have tried the following 2 events: GridDataBoundGrid.PrepareViewStyleInfo() and GridDataBoundGrid.CellDrawn().
The following is the code: private void gridVE_CellDrawn(object sender, GridDrawCellEventArgs e) { if (e.ColIndex == 0 && e.RowIndex != 0) { e.Style.Text = @"+ / -"; } }
As I have stepped through the PrepareViewStyleInfo event, for some reason the Column Index never = 0, and so that method doesn't work. As I have stepped through the CellDrawn event, the Column Index does hit 0, and the IF statement is entered, but the resulting grid control that is rendered does not show the text in the row headers.
RCRajadurai C Syncfusion Team March 9, 2009 05:18 AM UTC
Hi Pete,
Thanks for your interest in Syncfusion products.
To set custom text in rowheader and remove the black triangle(current row indicator) in griddataboundgrid, please try to set the celltype of rowheader as "Header".
Please refer to the following code handled in PrepareViewStyleInfo event this.gridDataBoundGrid1.PrepareViewStyleInfo += new Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventHandler(gridDataBoundGrid1_PrepareViewStyleInfo);