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

[Solved] Combo Box in Radgrid issue

1 Answer 99 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Extra
Top achievements
Rank 1
Extra asked on 17 Feb 2011, 05:25 AM
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();

        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;
        }

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 22 Feb 2011, 04:28 PM
Hi,

In order to provide you with an appropriate solution, I would need a bit more details about your exact scenario. How do you save the data in the database ? What do you mean by displaying the saved data in view mode ? Do you change different views ? Generally, any additional information about the business objects, the handled events and corresponding settings will be helpful. 

Greetings,
Maya
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
GridView
Asked by
Extra
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or