We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Allowing only Full Row Selection in a GDBG with Static cells

Hi
I am using a GDBG which is non editable and all cells are static. (just like a listbox)
I need a click on any cell to make the whole row highlighted.

Iset the AllowSelection to Row only and played with all sorts of other properties
I even did overriding to the Cell Click event and selected the whole row with code but that also doesnt work properly becuase the actual cell that was clicked remains white and is not highlighted like the rest of the row.
Can you please show me the best way to do it. Isnt there some kind of Property like in the regarding Visual Studio DataGrid .(Row Selection only)

Please help

1 Reply

AD Administrator Syncfusion Team February 14, 2007 03:39 PM UTC

Hi Ryan,

This can be achieved by setting the ListBoxSelectionMode to One and handling the CurrentCellActivating event to set e.ColIndex to zero. Here is a code snippet.

this.gridDataBoundGrid1.ListBoxSelectionMode = SelectionMode.One;

private void gridDataBoundGrid1_CurrentCellActivating(object sender, Syncfusion.Windows.Forms.Grid.GridCurrentCellActivatingEventArgs e)
{ e.ColIndex = 0;}

Here is KB article that shows you "How do I make a GridDataBoundGrid and a GridControl look exactly like a GridListControl using a DataTable datasource?"
http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=118

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon