Display specific string for NULL cell value

3 posts, 1 answers
  1. Jeff
    Jeff avatar
    42 posts
    Member since:
    Jun 2013

    Posted 28 Feb 2014 Link to this post

    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. Answer
    Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 03 Mar 2014 Link to this post

    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
  3. Jeff
    Jeff avatar
    42 posts
    Member since:
    Jun 2013

    Posted 03 Mar 2014 in reply to Dimitrina Link to this post

    Thanks Didie - that's what I needed.

    Jeff
Back to Top