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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid column header selection

Thread ID:

Created:

Updated:

Platform:

Replies:

50819 Oct 19,2006 05:11 PM UTC Oct 20,2006 06:38 PM UTC WinForms 2
loading
Tags: GridControl
Mark Atkinson
Asked On October 19, 2006 05:11 PM UTC

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?

Mark Atkinson
Replied On 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?

Jayakumar Natarajan [Syncfusion]
Replied On 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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;