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.
Unfortunately, activation email could not send to your email. Please try again.

Select Row in DataBoundGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

44246 May 18,2006 04:07 AM May 18,2006 05:02 AM Windows Forms 2
loading
Tags: GridControl
Nick Gardner
Asked On May 18, 2006 04:07 AM

Hi, How can ensure that only the whole row is selected when a user clicks any cell in a databound grid? Thanks, Nick

Administrator [Syncfusion]
Replied On May 18, 2006 04:37 AM

Hi Nick, Try this code to select a row in a Grid. Here is a code snippet. this.gridDataBoundGrid1.ListBoxSelectionMode = SelectionMode.One Best Regards, Haneef

Administrator [Syncfusion]
Replied On May 18, 2006 05:02 AM

Hi Nick, Sorry for the inconvenience caused. To check the selection type, you need to handle the Grid.Model.Selectionchanging event. Here is a code snippet. //Form Load. this.grid.Model.SelectionChanging +=new GridSelectionChangingEventHandler(Model_SelectionChanging); GridRangeInfo info = this.grid.Model.SelectedRanges.ActiveRange; if(info.IsRows) { Console.WriteLine("Row Selection"); } else if(info.IsCols ) { Console.WriteLine("Column Selection"); } else if(info.IsTable ) { Console.WriteLine("Table Selection"); } else if(info.IsCells) { Console.WriteLine("Cell Selection"); } else Console.WriteLine("Empty Selection"); Let me know if this helps. Best Regards, Haneef

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.

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.

;