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

Format for null values

Thread ID:





64863 Jul 24,2007 12:27 PM UTC Jul 24,2007 02:55 PM UTC WinForms 1
Tags: GridControl
Lucia Diaconu
Asked On July 24, 2007 12:27 PM UTC

Is there a way to define a string to be displayed for null values in a cell?

I want to display a - sign when null values appear in any cell, regardless of the column type.

haneefm [Syncfusion]
Replied On July 24, 2007 02:55 PM UTC

Hi Lucia,

You can do this dynamically in DrawCellDisplayText. This way you do not modify the actual datatable values, but instead just change what the grid displays.

private void gridDataBoundGrid1_DrawCellDisplayText(object sender, GridDrawCellDisplayTextEventArgs e)
if(e.Style.CellIdentity.ColIndex == 1)
if(e.Style.CellValue == null && e.DisplayText == String.Empty)
e.DisplayText = "-";
e.Cancel = true;

Best regards,


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