This is a migrated thread and some comments may be shown as answers.

NullDisplayText attribute

10 Answers 84 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Aaron
Top achievements
Rank 1
Aaron asked on 27 Sep 2012, 03:37 AM
I'm finding RadGridView doesn't respect the "NullDisplayText" attribute given within my model. I found a post 6 years ago that says "Yeah, we should do that..."

I haven't seen anything else. Is there a good, extensible workaround? Will this be added in the future?

10 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 27 Sep 2012, 05:29 AM
Hi,

 Can you clarify what is NullDisplayText?

Regards,
Vlad
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

0
Aaron
Top achievements
Rank 1
answered on 27 Sep 2012, 04:54 PM
http://msdn.microsoft.com/en-us/library/cc679253(v=vs.95).aspx 

I know the GridView handles "DataFormatString" but it doesn't seem to handle NullDisplayText.
0
Accepted
Vlad
Telerik team
answered on 01 Oct 2012, 07:35 AM
Hi,

 This will be added for our upcoming Q3 2012 release (after three weeks). 

Greetings,
Vlad
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

0
Robert
Top achievements
Rank 1
answered on 23 Apr 2016, 11:37 AM
And in Q1 2016 it appears not to be working.  NullDisplayText is completly ignored (though DataFormatString is applied).
0
Robert
Top achievements
Rank 1
answered on 23 Apr 2016, 11:44 AM
Ah, I was trying to use it in WPF; it is sad it isn't there though :)
0
Yoan
Telerik team
answered on 26 Apr 2016, 02:45 PM
Hello,

It is working in my WPF test project. You can find it attached. However, if you have applied DataFormatString of the column, the NullDisplayText attribute will not be respected.

Regards,
Yoan
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Robert
Top achievements
Rank 1
answered on 27 Apr 2016, 06:24 AM

I have a column of weights, but for some rows, the weight is unknown (not 0, but really unknown).  I would like it to say "4 kg" in the cell that belongs to a row with a weight that is 4 kg, and "" (the empty string) in the cell that belongs to a row with an unknown weight.

 

This functionality exist with plain bindings (via TargetNullValue) for ordinary TextBoxes.  Syncfusion SfDataGrid (a competitors alternative to RadGridView) supports this.  I am fine with needing to do things different with Telerik controls, but surprised that such a simple feature is missing.

0
Yoan
Telerik team
answered on 27 Apr 2016, 08:00 AM
Hello Robert,

Maybe I am missing something, but the TargetNullValue is working as expected. I have attached a modified version of my previous attached project. I have used the TargetNullValue property in the DataMemberBinding of the column and it is respected. 

Regards,
Yoan
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Robert
Top achievements
Rank 1
answered on 02 May 2016, 08:33 AM
So we can now agree that this doesn't work.  FormatString combined with TargetNullValue supresses the later.  I am opening a ticket then.
0
Stefan Nenchev
Telerik team
answered on 04 May 2016, 10:00 AM
Hi Robert,

I just wanted to update the forum thread that  the behavior is logged as a bug in our Feedback and Ideas Portal at the following page - StringFormat in DataMemberBinding does not respect TargetNullValue property. We have investigated it in the ticket you have raised and confirmed the undesired effects.

Regards,
Stefan Nenchev
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
GridView
Asked by
Aaron
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Aaron
Top achievements
Rank 1
Robert
Top achievements
Rank 1
Yoan
Telerik team
Stefan Nenchev
Telerik team
Share this question
or