True/False to Yes/No

2 posts, 0 answers
  1. Brian Mains
    Brian Mains avatar
    485 posts
    Member since:
    Oct 2008

    Posted 03 May 2011 Link to this post

    Hello,

    We bind boolean values and it translates the value to True/False (via the ToString()) method.  We often write code to translate this to Yes/No.  Is there an easy way in markup to translate the True/False to Yes/No, or does this always have to be in code?  If via the GridCheckBoxColumn, maybe?

    Thanks.
  2. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 03 May 2011 Link to this post

    Hello Brian,

    You can use a template column and inject a declarative binding expression inside its item template like this one:

    <%# ((bool)DataBinder.Eval(Container.DataItem,"Discontinued") == false ? "Yes" : "No") %>

    to achieve your goal.

    You can see that applied in action for our RadListView control on this live demo:
    http://demos.telerik.com/aspnet-ajax/listview/examples/databinding/simplevsadvancedbinding/defaultcs.aspx

    Regards,
    Sebastian
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top