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

Cell value format ..

hi:

i am trying something pretty basic. i want to set the value of a cell to be null when the value is 0.0. Its of type double. Setting it to DBNull.Value is causing GDBG to not behave.

what is the proper null value for a cell?

thanks.

1 Reply

AD Administrator Syncfusion Team October 16, 2006 05:31 AM UTC

Hi LI,

You can handle the DrawCellDisplayText event of the grid and set the e.DisplayText to some new value to want to display. Use the e.Style.CellIdentity.RowIndex and e.Style.CellIdentity.ColIndex to get the row and column of the cell for which the displaytext has to be set. Below is a code snippet.

private void gridDrawCellDisplayText(object sender, GridDrawCellDisplayTextEventArgs e)
{
if( e.DisplayText == "00.00")
e.DisplayText = String.Empty;
}

Please refer to the below sample for more details.
http://www.syncfusion.com/Support/user/uploads/GDBGNullValue_e39f0d3f.zip

Let me know if this works.
Best Regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon