Problem with binding and displaying item

2 posts, 0 answers
  1. Vinicius
    Vinicius avatar
    1 posts
    Member since:
    Aug 2012

    Posted 14 Aug 2012 Link to this post

    I have a GridViewComboBoxColumn binded to a Dp, like shown below:

    <telerik:GridViewComboBoxColumn
                        Width="150"
                        Header="Custa tipo"
                        x:Name="costTypeColumn"
                        DataMemberBinding="{Binding Path=CostType.Id, Mode=TwoWay, NotifyOnValidationError=True}"
                        SelectedValueMemberPath="Id"
                        DisplayMemberPath="Name"
                        ItemsSource="{Binding Source={StaticResource costParcelViewModelViewSource}, Path=CostTypes, Mode=TwoWay}">
                        
                    </telerik:GridViewComboBoxColumn>

    and also this is my DP:

    public static readonly DependencyProperty CostTypesProperty =
        DependencyProperty.Register("CostTypes", typeof(CostTypeCollection), typeof(CostParcelViewModel), null);
    public CostTypeCollection CostTypes
    {
        get { return (CostTypeCollection)GetValue(CostTypesProperty); }
        set { SetValue(CostTypesProperty, value); }
    }

    My problem is: ComboboxColumn do not show items on normal mode, only in edit mode. So i select the item i want and then when i press "Tab"(to go to next item) it disappears. Also, i't seems that the bind is not two way, once its not saving and showing a message that my "Model" has BrokenRules(i've checked and this property is null);

    Can you help me? Hope i was clear.
    Thanks!
  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 15 Aug 2012 Link to this post

    Hello,

    Generally this problem is troubleshooted in this help article. As you have already used a StaticResource to specify the source, then may I ask you to check the Output window for binding errors? I am not sure that I understand this line:
    "i't seems that the bind is not two way, once its not saving and showing a message that my "Model" has BrokenRules(i've checked and this property is null);". Would you please clarify?

    All the best,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top