Want to display "Yes"/"No" in a column for Boolean value instead of checkbox in RadGridView for WPF

6 posts, 0 answers
  1. MSI
    MSI avatar
    4 posts
    Member since:
    Feb 2016

    Posted 23 Feb Link to this post

    I would like to display "Yes" or "No" for a Boolean in RadGridView instead of a checkbox. I would like to implement this changes in xaml. Columns are generating dynamically. This is how it's created now:

     <telerik:RadGridView x:Name="Data" Grid.Row="3" Margin="5" AutoGenerateColumns="False" CanUserSortColumns="True" IsFilteringAllowed="True"
                                     grid:RadGridViewColumnsBinding.ColumnsCollection="{Binding Path=Columns}"
                                     IsReadOnly="False" CanUserResizeColumns="True"/>

     

    I am new in Silverlight coding. Will really appreciate if someone can help.

  2. Dilyan Traykov
    Admin
    Dilyan Traykov avatar
    371 posts

    Posted 25 Feb Link to this post

    Hello,

    I'm attaching a sample project based on your requirements. All I've done is added a BooleanToYesNo converter and set it as the Converter for the respective binding. Please have a look and let me know whether this works for you.

    Regards,
    Dilyan Traykov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. MSI
    MSI avatar
    4 posts
    Member since:
    Feb 2016

    Posted 02 Mar in reply to Dilyan Traykov Link to this post

    Thank you for the attached project. This was very helpful. On a different note, currently in the checkbox, when none of data there in backend it shows a blue sign in the checkbox. (for 1 it shows as checked, for 0 shows as unchecked/blank). Any idea how this blue sign could be setup or how to get rid of the blue signfrom the Checkbox?
  5. Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 03 Mar Link to this post

    Hi,

    I am not sure that I can understand your question. May I ask you to share more details? An image would be helpful.

    Regards,
    Yoan
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. MSI
    MSI avatar
    4 posts
    Member since:
    Feb 2016

    Posted 03 Mar in reply to Yoan Link to this post

    In the image where it shows blank in checkbox for 'false' and checked for 'true'. Where no true false has been passed(the value is null), it shows this blue/purple sign in the checkbox. Want to get rid of it. Couldn't figure how it's implemented there.
  7. Dilyan Traykov
    Admin
    Dilyan Traykov avatar
    371 posts

    Posted 07 Mar Link to this post

    Hello,

    The blue sign you're referring to is the undetermined state of the Tri-State CheckBox.
    One way to get rid of it, if applicable, is to make the respective boolean property of your business object non-nullable so that a default value of false is set.

    Your other option is to style the CheckBoxColumn, and more specifically - the IndeterminatePath of its Indeterminate visual state, to your liking.

    I hope you find these suggestions helpful.

    Regards,
    Dilyan Traykov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for WPF is Visual Studio 2017 Ready