Checkbox images in DataGridBooleanColumn

5 posts, 1 answers
  1. Alessandro
    Alessandro avatar
    24 posts
    Member since:
    May 2013

    Posted 12 Mar 2015 Link to this post

    Hi,
    I'm using DataGrid and already updated with latest release Q1 2015.
    In DataGridBooleanColumn there are two images to show checkbox status binded to a boolean value, and I need to change them if possibile. Especially that one showing false value.
    So is it possible to use custom images in DataGridBooleanColumn? I imagine there's a style for that?! 

    Thank you in advance for any help you may give.

    Alessandro
  2. Tsvyatko
    Admin
    Tsvyatko avatar
    833 posts

    Posted 17 Mar 2015 Link to this post

    Hi Alessandro,

    Currently, you cannot alter the default symbols used to display the checked and unchecked state as the item displayed is actually textblock (used for performance reasons). Thus you can control only the appearance of the text.

    If you are looking for a custom visualization of the boolean data you can use template column and place you custom content in CellContentTemplate.



    Regards,
    Tsvyatko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. Alessandro
    Alessandro avatar
    24 posts
    Member since:
    May 2013

    Posted 17 Mar 2015 in reply to Tsvyatko Link to this post

    Hi,
    thank you for your suggestion. Template column is the way indeed !
    BTW, it seems not possible to sort a template column or even a image column binded to a boolean property of the model and using a converter to get the image as path. 
    So I suppose I have to use sortdescriptors using the command CustomColumnHeaderTapCommand when I click on a header. Quite difficult to implement but problem here is that I loose sort indicators (little arrows).
    Sorry to post another question here but I really need to understand if I'm going in the right direction.
    Thank you.

    Alessandro

















  4. Answer
    Tsvyatko
    Admin
    Tsvyatko avatar
    833 posts

    Posted 17 Mar 2015 Link to this post

    Hello Alessandro,

    You can assign the sort descriptor that you need for the template column using DataGridTemplateColumn.SortDescriptor property. You can find more about the template column capabilities in this help article- http://docs.telerik.com/windows-universal/controls/raddatagrid/columns/datagrid-templatecolumn

    Regards,
    Tsvyatko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  5. Alessandro
    Alessandro avatar
    24 posts
    Member since:
    May 2013

    Posted 19 Mar 2015 in reply to Tsvyatko Link to this post

    Dear Tsvyatko,
    thank you again... you saved my day :)
Back to Top