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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Select Row in DataBoundGrid

Thread ID:





44246 May 18,2006 08:07 AM UTC May 18,2006 09:02 AM UTC WinForms 2
Tags: GridControl
Nick Gardner
Asked On May 18, 2006 08:07 AM UTC

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 08:37 AM UTC

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 09:02 AM UTC

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


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

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