This is a migrated thread and some comments may be shown as answers.

Problem with binding and displaying item

1 Answer 7 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Vinicius
Top achievements
Rank 1
Vinicius asked on 14 Aug 2012, 06:06 PM
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!

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 15 Aug 2012, 05:57 AM
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.

Tags
GridView
Asked by
Vinicius
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or