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

GDBG Deleting Columns

Thread ID:





35364 Sep 28,2005 03:06 PM UTC Sep 30,2005 01:43 AM UTC WinForms 1
Tags: GridControl
Osden Pereira
Asked On September 28, 2005 03:06 PM UTC

Hi, I am using a GDBG and I want only certain columns to be editable...this works fine..only problem is, when the user selects an entire column by clicking the header and presses the delete key, the entire data in all the cells of that column are deleted, i tried lotsa events, but none of them seem to be catching the delete keypress. I am attaching the code file. Please help me out on this. Regards, Osden Pereira. Request_5448.zip

Administrator [Syncfusion]
Replied On September 30, 2005 01:43 AM UTC

There are two ways to avoid the Delete key clearing cells. 1) Derived from GridDataBoundGrid and override the ShouldDeleteKeyClearCells method. This is how the default version looks like: protected virtual bool ShouldDeleteKeyClearCells() { if (!Model.Options.ExcelLikeCurrentCell) { return Model.SelectedRanges.Count > 0; } else { return Model.SelectedRanges.Count > 1 || Model.SelectedRanges.Count == 1 && !CurrentCell.RangeInfo.Contains(Model.SelectedRanges[0]); } } 2) Another options is to listen to the ClearingCells event. In your event handler set e.Handled = true if the selected range is a column. 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

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