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

Display specific string for NULL cell value

2 Answers 150 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 28 Feb 2014, 05:02 PM
I'm using RadGridView to display DataTable.DataView collections.  In the underlying data, it's perfectly valid for some of the fields to be null.  However, rather than simply displaying those fields as a "blank" cell in the grid, I'd prefer to display a predefined string (say, "<null>" for example).  Is there an easy way to accomplish this?

One possible restriction on a solution is that the grid is used to display "random" DataView's and auto-generates the columns for each.  So, the solution would need to work in that circumstance.

Thanks for any advice.

Jeff

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimitrina
Telerik team
answered on 03 Mar 2014, 11:57 AM
Hello Jeff,

In order to display a value different than the bound one you should apply a Converter to the binding. As your columns are auto generated, you could subscribe for RadGridView's AutoGeneratingColumn event and additionally apply a converter when needed.

Regards,
Didie
Telerik
0
Jeff
Top achievements
Rank 1
answered on 03 Mar 2014, 03:12 PM
Thanks Didie - that's what I needed.

Jeff
Tags
GridView
Asked by
Jeff
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Jeff
Top achievements
Rank 1
Share this question
or