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

DataGrid FAQ 5.36 almost gets me what I want.

Thread ID:





236 May 7,2002 05:12 PM UTC May 8,2002 06:18 AM UTC WinForms 1
Tags: FAQ
Brandon Wilhite
Asked On May 7, 2002 05:12 PM UTC

DataGrid FAQ 5.36 says, "How can I make my grid never have an active edit cell and always select whole rows (as in a browser-type grid)?". I downloaded the example project and this works great but, selecting multiple rows using the Shift and Ctrl keys doesn't work how you'd expect it to when click in the cells. This also seems to mess up the way the ctrl-click on the row hearder works for non-sequential multi-select. Here's what I'm trying to attempt to do: Make the selection functionality of a Datagrid work simular to that of the ListView in Details mode with FullRowSelect on. So I want to be able to click anywhere on a DataGrid Row and have it select the whole row, not just the clicked cell. On top of that I'd like to be able to hold down the shift key and have the Rows between my last selected Row and the current one get Selected. Simularily, I'd like it if holding down the Ctrl Key and clicking a row would simply at that row to the Selected rows. Any ideas how to do this?

Clay Burch [Syncfusion]
Replied On May 8, 2002 06:18 AM UTC

You can still use a custom column style to handle the current cell not being active, but you cannot select/unselect the rows down in the override as with the single-select solution. Instead, subclass your datagrid, override OnMouseDown and change all cell clicks into row header clicks. Also override OnCurrentCellChanged and call the OnMouseDown from your override to simulate a click in the next currentcell to handle moving the currentcell with the keyboard. The above FAQ now has samples that implements a multi-select browser grid using these ideas. http://www.syncfusion.com/faq/winforms/search/856.asp


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

This page will automatically be redirected to the 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

Live Chat Icon For mobile
Live Chat Icon