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

Selection behavior

Thread ID:





7726 Oct 7,2003 05:31 PM UTC Oct 10,2003 11:41 AM UTC WinForms 7
Tags: GridControl
Vladimir Arkhipov
Asked On October 7, 2003 05:31 PM UTC

Hi, I have 2 questions: 1. SelectionMode.One I press Esc button -> selection disappeared. Is it possible to have a persistent selection? 2. SelectionMode.One I press Delete button -> data disappeared from the whole row. Is it possible to make changes to current cell only? Vladimir

Administrator [Syncfusion]
Replied On October 7, 2003 07:13 PM UTC

1. One idea would be to handle KeyDown and KeyUp and set a flag if Escape is pressed and reset it in KeyUp. You can then handle the selectionChanging event and set e.Cancel = true if Escape was pressed. 2. Again handle KeyDown, KeyUp, set flag and then in ClearingCells set e.Handled = true. Stefan

Vladimir Arkhipov
Replied On October 8, 2003 05:17 PM UTC

Thank you (50%) 2. ClearingCells works!, I just added code like this: if(e.RangeList.ActiveRange.IsRows) { e.Handled = true; } 1. SelectionChanging event is not fired on Esc button press, selection just silently disappeared:(. Vladimir

Administrator [Syncfusion]
Replied On October 8, 2003 06:13 PM UTC

I will have to look into why SelectionChanging is not raised for Escape key. Will probably need to make some code changes in the grid sources for that. But, try a) set grid.WantEscapeKey = false - or - b) override OnKeyDown and CurrentCellKeyDown and check for Keys.Escape and don't call base class version and set e.Handled = true Does that help? Stefan

Vladimir Arkhipov
Replied On October 8, 2003 06:49 PM UTC

WantEscapeKey works great! Thanks!!!

Vladimir Arkhipov
Replied On October 8, 2003 06:49 PM UTC

WantEscapeKey works great! Thanks!!!

Vladimir Arkhipov
Replied On October 10, 2003 10:35 AM UTC

There is though one problem with WantEscapeKey = false. It works fine for standard text boxes, but if my cell have an image in it then "WantEscapeKey = false" resulted in blocking escape functionality. So if I am in edit mode Esc press restores initial values for standard text box and do nothing for text box with ImageIndex >= 0. Is it possible to fix it? Vladimir

Administrator [Syncfusion]
Replied On October 10, 2003 11:41 AM UTC

Can you handle the CurrentCellKeyDown event and add necessary code for what you want to with the Escape key? (e.g. call CurrentCell.RejectChanges) Stefan


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