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

Reg: GridDataBoundControl

Hi, I am using griddataBound Control. For validation (double) i am using CurrentCellValidateString event. Note : DB Column allows null values. Error msg i am capturing in ValidateFailed event.(Actually i dont want error msg) this.sgbDetailedHistory.CurrentCell.ErrorMessage = ""; (Blank) All above working fine.But i am facing problem. Scenorio: 1) Enter double value in the grid cell. 2) Delete the value. 3) Try to move to other cell. I am not able to move to other cell. I have to fill some value then only i can able to move. How do i handle this scenorio..?

6 Replies

AD Administrator Syncfusion Team August 30, 2005 10:06 AM UTC

Does the code in your CurrentCellValidateString allow empty strings to be processed without setting e.Cancel = true? If you set e.Cancel=true, either in CurrentCellValidateString or in CurrentCellValidating, when the string is empty, then that is why your user cannot leave such a cell. You should not set e.Cancel = true in this case.


AD Administrator Syncfusion Team August 30, 2005 10:28 AM UTC

I do not have any special handlers. Here is project. Try to add some records in the grid, you will see empty lines in output. Doesn''t matter release or debug configuration. WindowsApplication37_8603.zip


AS Anna Srinivasan August 30, 2005 11:01 AM UTC

Please go through the following code .. private void sgbDetailedHistory_CurrentCellValidateString(object sender, Syncfusion.Windows.Forms.Grid.GridCurrentCellValidateStringEventArgs e) { try { GridCurrentCell cc = this.sgbDetailedHistory.CurrentCell; string newValue = e.Text; if(cc.ColIndex >= 2 && cc.ColIndex <= 6) { double d; if (newValue.Trim() != "") { if(!double.TryParse(newValue, System.Globalization.NumberStyles.Any, null, out d)) { } } } } catch (Exception ex) { Logger.WriteLogEntry("Error in DateTime Convertion", ex, LogType.Error); } } private void sgbDetailedHistory_ValidateFailed(object sender, Syncfusion.Windows.Forms.Grid.GridValidateFailedEventArgs e) { this.sgbDetailedHistory.CurrentCell.ErrorMessage = ""; } I am not using any other event.


AD Administrator Syncfusion Team August 30, 2005 11:06 AM UTC

What version of our libraries are you using? In earlier versions, you could not leave a double column with it containing an empty string. But you can in the more recent releases.


AS Anna Srinivasan August 30, 2005 11:49 AM UTC

Right now we are using 3.2.1.0 version. It is not possible in this version.


AD Administrator Syncfusion Team August 30, 2005 02:30 PM UTC

No, this should work in 3.2.1.0. Here is a sample showing youable to delete the number in the first column and move off the cell. How do I see teh problem in this sample? http://www.syncfusion.com/Support/user/uploads/GDBG_ccf93c59.zip

Loader.
Live Chat Icon For mobile
Up arrow icon