2 posts, 0 answers
  1. ITA
    ITA avatar
    384 posts
    Member since:
    Aug 2009

    Posted 11 Jun 2012 Link to this post


    i found this example to change the CellTemplate. This works fine, but how do i insert a "Passwordbox"?

    <telerik:RadGridView x:Name="RadGridView" AutoGenerateColumns="False" >
                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Select hobby" />
                    <telerik:GridViewDataColumn  >
                                <telerik:RadComboBox ItemsSource="{Binding AvailableHobbies}" >
                                            <TextBlock Text="{Binding Owner.Choices}" />
                                            <StackPanel Orientation="Horizontal">
                                                <CheckBox IsChecked="{Binding IsChecked, Mode=TwoWay}"
                         Content="{Binding Description}" />
                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Choices}" />

    With Passwordbox:

          <StackPanel Orientation="Horizontal">
               <Passwordox Name="Password_txt"  Password="{Binding Password}"  />

    binding does not work, but why? A simple Textbox ist working fine with this Binding!
    Thanks Best Regards

  2. Ivan Ivanov
    Ivan Ivanov avatar
    1201 posts

    Posted 11 Jun 2012 Link to this post


    PasswordBox's Password property is not a dependency property, so that one cannot bind it to a property of his/her ViewModel. Here is a thread from the .NET community forum that sheds some more light on best practices when using PasswordBox.

    All the best,
    Ivan Ivanov
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Back to Top