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

Empty strings and DBNull

Thread ID:





40452 Feb 2,2006 11:44 PM UTC Feb 3,2006 11:59 AM UTC WinForms 1
Tags: GridControl
Keyur Patel
Asked On February 2, 2006 11:44 PM UTC

I have a GDBG. One of the columns is type string. If I delete the contents of a cell in this column, the grid sets the cellvalue to an empty string (""). I am using the grid with an Oracle database, which does not allow empty strings. Is there a setting that I can use to automatically set the cell to DBNull.Value instead of an empty string? Or, do I have to use the CurrentCellValidated event?

Administrator [Syncfusion]
Replied On February 3, 2006 11:59 AM UTC

Hi Keyur, You can use the CurrentCellValidating event for validating the cell value. Here is the code snippet. private void gridDataBoundGrid1_CurrentCellValidating(object sender, System.ComponentModel.CancelEventArgs e) { GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell; if(cc.Renderer.ControlText == "") cc.Renderer.ControlValue = System.DBNull.Value; } Let us know if you need further assistance, Regards, Madhan.


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