Help with Binding the toggleswitch

3 posts, 1 answers
  1. GJ Kuz
    GJ Kuz avatar
    29 posts
    Member since:
    May 2011

    Posted 04 Nov 2012 Link to this post

    Dear Telerik Team,

    I am trying to bind the RadToggleSwitch control with my viewmodel and I can't seem to get it working. The field is defined as bool and is also nullable. Could you please help me?
    <telerikPrimitives:RadToggleSwitch Header="Trade-in Deduction" Name="tsTradeinCredit" Grid.ColumnSpan="2" Margin="12,0,8,0" IsChecked="{Binding HasTradeInDeducation}" Checked="tsTradeinCredit_Checked" Unchecked="tsTradeinCredit_Unchecked" TabIndex="1" >
                                            <ContentControl Foreground="Black" Content="{Binding}" FontFamily="Segoe WP" FontSize="22.5"/>
                                            <ContentControl Content="{Binding}"  Foreground="Black" FontFamily="Segoe WP" FontSize="22.5" />
  2. Answer
    Todor avatar
    772 posts

    Posted 06 Nov 2012 Link to this post

    Hi Gilles,

    Thank you for contacting us.

    I used your code and had no issues binding the IsChecked property to a nullable boolean property of a ViewModel. Could you please have a look at the attached project and let me know if I'm missing something?

    Kind regards,
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. GJ Kuz
    GJ Kuz avatar
    29 posts
    Member since:
    May 2011

    Posted 14 Nov 2012 Link to this post

    Hi Todor,

    The sample works great!!! It was a stupid mistake on my side. Sorry for the trouble.

Back to Top