The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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?
ADAdministrator Syncfusion Team 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.