Skip to content

A Simple Datagrid Question?

AB

Asked Feb 15, 2006, 1:43 AM EST2 answers
Share
LinkedInX
Hello. It is perhaps a simple Datagrid problem, but it's held me for ages. I am getting data from a simple Access database which I exhibit in a Datagrid. At times values (numeric and text) are missing and the Datagrid shows "(null)". Can the grid be made to show "N/A" (say) for values that are not available? Thanks in advance!

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    You can customize your datagrid view by adding code in DataGrid.ItemDataBound Event. This will enable you to access the data grid data before it is displayed. 
    Or 
    when you query the data from the database, use ISNULL() function to have your custom value if the column value is null,

    ex: SELECT ISNULL(process_date, 'N/A' ) AS ProcessDate FROM Process

    Cheers!
     
    0
  • 0
    Thanks again, Subi and Binu, for your response! It's a Windows Application and I simply had to set the "nullText" value for the columns in the datagrid to "N/A."
    0