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

Restrict deleting a cell value on editable grid

Thread ID:

Created:

Updated:

Platform:

Replies:

19041 Sep 16,2004 11:45 AM UTC Sep 16,2004 12:22 PM UTC WinForms 1
loading
Tags: GridControl
Kanika
Asked On September 16, 2004 11:45 AM UTC

I have an editable grid which consists of columns of type "dropdown" and "text".Now if the user selects the cell and press delete key the value in the cell gets deleted. The issue is: 1. Text box cell type:To restirct deleting the cell value,i have used the following code: private void dgAnalysis_CurrentCellValidateString(object sender, Syncfusion.Windows.Forms.Grid.GridCurrentCellValidateStringEventArgs e) { if((e.Text == "") || (e.Text == DBNull.Value.ToString())) { MessageBox.Show("Null is not the valid value." ); e.Cancel = true; } } Now sometimes this code runs and somtimes allow me to come out of the cell without any error. 2.ComboBox Cell Type : I have set the drop down "ExclusiveChoiceList" property to true. a)Select the value from drop down. b)set focus to some other cell c)Bring the focus to cell in step a. d)Press Delete Key. The value will be deleted from the cell.Also note that the value is not deleted from the combo box. Can you suggest the solution to restrict delete in above two cases.

Administrator [Syncfusion]
Replied On September 16, 2004 12:22 PM UTC

Try handling the grid.Model.ClearingCells event, and set e.Handled = true and e.Result = false if e.RangeList contains a cell you do not want to delete.

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.

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

;