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.
Unfortunately, activation email could not send to your email. Please try again.

Empty strings and DBNull

Thread ID:

Created:

Updated:

Platform:

Replies:

40452 Feb 2,2006 06:44 PM Feb 3,2006 06:59 AM Windows Forms 1
loading
Tags: GridControl
Keyur Patel
Asked On February 2, 2006 06:44 PM

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 06:59 AM

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.

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.

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.

;