This question is locked. New answers and comments are not allowed.
Hi telerik,
I had a radgridview binding a table like the following, it can let me choose the option from the following code and save to the database perfectly, but when i go back again, it can't display the value that saved in the db in view mode.
Did I using the wrong method? How can I display the saved data in the combo box when it was in view mode?
The combo box was binding to one of the field of the same binding source of the radgridview.
Thank you very much
<xaml>
<telerik:RadGridView x:Name="RadGridViewParts" ItemsSource="{Binding Parts}" SelectionMode="Extended" AutoGenerateColumns="False" Margin="0,5,0,0" Grid.Row="1" ActionOnLostFocus="None">
<telerik:GridViewDataColumn DataMemberBinding="{Binding Parts_Name, Mode=TwoWay}" Header="Parts Desc" Width="400"/>
<telerik:GridViewComboBoxColumn x:Name="PartsLocationCombo" DataMemberBinding="{Binding Parts_Location, Mode=TwoWay}" Header="Location" Width="80" DisplayMemberPath="Value" SelectedValueMemberPath="ID" />
<C#>
((GridViewComboBoxColumn)this.RadGridViewParts.Columns[1]).ItemsSource = GetListOfPartsLocaton();
I had a radgridview binding a table like the following, it can let me choose the option from the following code and save to the database perfectly, but when i go back again, it can't display the value that saved in the db in view mode.
Did I using the wrong method? How can I display the saved data in the combo box when it was in view mode?
The combo box was binding to one of the field of the same binding source of the radgridview.
Thank you very much
<xaml>
<telerik:RadGridView x:Name="RadGridViewParts" ItemsSource="{Binding Parts}" SelectionMode="Extended" AutoGenerateColumns="False" Margin="0,5,0,0" Grid.Row="1" ActionOnLostFocus="None">
<telerik:GridViewDataColumn DataMemberBinding="{Binding Parts_Name, Mode=TwoWay}" Header="Parts Desc" Width="400"/>
<telerik:GridViewComboBoxColumn x:Name="PartsLocationCombo" DataMemberBinding="{Binding Parts_Location, Mode=TwoWay}" Header="Location" Width="80" DisplayMemberPath="Value" SelectedValueMemberPath="ID" />
<C#>
((GridViewComboBoxColumn)this.RadGridViewParts.Columns[1]).ItemsSource = GetListOfPartsLocaton();
private List<Parts_Location_ComboBox> GetListOfPartsLocaton()
{
List<Parts_Location_ComboBox> partsLocationCombox = new List<Parts_Location_ComboBox>();
partsLocationCombox.Add(new Parts_Location_ComboBox() { ID = "T", Value = "T" });
partsLocationCombox.Add(new Parts_Location_ComboBox() { ID = "A", Value = "A" });
partsLocationCombox.Add(new Parts_Location_ComboBox() { ID = "B", Value = "B" });
partsLocationCombox.Add(new Parts_Location_ComboBox() { ID = "C", Value = "C" });
return partsLocationCombox;
}