Click here to Skip to main content
Sign Up to vote bad
good
See more: C#Gridview
Using NullDisplayText  
BoundField bField = new BoundField();
                bField.ItemStyle.Wrap = false;
bField.DataField = "ProjectID"
bField.NullDisplayText = "NO";
GVProjects.Columns.Add(bField);
 
It does not display NullDisplayText = "NO" .
 
Please if anyone help?
Posted 4 Jan '13 - 5:41
Edited 4 Jan '13 - 5:43

Comments
Member 9581488 - 4 Jan '13 - 11:45
check what is the value of projectID. Sometimes it returns empty string from database.
Sandeep Mewara - 4 Jan '13 - 11:57
What does it display?

1 solution

As per MSDN: The caption displayed for a field when the field's value is null. The default is an empty string (""), which indicates that this property is not set.
Refer: MSDN: BoundField.NullDisplayText Property [^]
 
Thus, if you don't see 'NO', it might be that the value returned is not NULL. Make sure the query result has value as NULL such that the text representation is correct at front end as you want it to be.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 OriginalGriff 213
1 Sergey Alexandrovich Kryukov 159
2 Richard MacCutchan 150
3 Maciej Los 136
4 Tadit Dash 110
0 Sergey Alexandrovich Kryukov 10,264
1 OriginalGriff 7,937
2 CPallini 4,201
3 Rohan Leuva 3,522
4 Maciej Los 3,135


Advertise | Privacy | Mobile
Web02 | 2.6.130523.1 | Last Updated 4 Jan 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid