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

Grid column header selection

I'm unable to repro this issue all the time but sometimes when I have no data in my grid and just a column header row, that header row becomes selected.
It may be something I'm doing but is there any obvious way to never have the column header row selected?

2 Replies

MA Mark Atkinson October 19, 2006 05:28 PM UTC

I forgot to mention, I'm using a GridDataBoundGrid control.

>I'm unable to repro this issue all the time but sometimes when I have no data in my grid and just a column header row, that header row becomes selected.
It may be something I'm doing but is there any obvious way to never have the column header row selected?


JN Jayakumar Natarajan Syncfusion Team October 20, 2006 06:38 PM UTC

Hi Mark,
Please try setting the Grid.AllowSelection property to exclude the columns and handle the Model.SelectionChanging as shown below to see if that helps.


this.gridDataBoundGrid1.AllowSelection = ((Syncfusion.Windows.Forms.Grid.GridSelectionFlags)(((((((Syncfusion.Windows.Forms.Grid.GridSelectionFlags.Row | Syncfusion.Windows.Forms.Grid.GridSelectionFlags.Table)
| Syncfusion.Windows.Forms.Grid.GridSelectionFlags.Cell)
| Syncfusion.Windows.Forms.Grid.GridSelectionFlags.Multiple)
| Syncfusion.Windows.Forms.Grid.GridSelectionFlags.Shift)
| Syncfusion.Windows.Forms.Grid.GridSelectionFlags.Keyboard)
| Syncfusion.Windows.Forms.Grid.GridSelectionFlags.AlphaBlend)));


this.gridDataBoundGrid1.Model.SelectionChanging += new GridSelectionChangingEventHandler(Model_SelectionChanging);

private void Model_SelectionChanging(object sender, GridSelectionChangingEventArgs e)
{
if(e.Range == GridRangeInfo.Row(0) || e.Range == GridRangeInfo.Table())
{
e.Cancel = true;
}
}


Best regards,
Jay

Loader.
Live Chat Icon For mobile
Up arrow icon