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

Problem with ComboBoxColumn in radGridView

2 Answers 46 Views
GridView
This is a migrated thread and some comments may be shown as answers.
hosein
Top achievements
Rank 1
hosein asked on 12 Feb 2011, 03:27 PM

Hello

I have three tables(Person, Phones, Type). I attached a picture for these tables and relationships.

I want to show the Person table as Parent grid and the Phones table as a Child grid in radGridView and I want to show the Phone Types in a combobox column in child grid too. So I Binded the child grid to the Phones table and added a ComboboxColumn to the child grid then binding it (Combobox Column) to the Type  table.

There is no trouble with it while Inserting a new row but When it loads the data form database it does not show the Phone Type I Selected before.

How can I load data and show the PhoneType Selected (and saved in database)?

I hope you can get me

Regards

2 Answers, 1 is accepted

Sort by
0
Accepted
Julian Benkov
Telerik team
answered on 16 Feb 2011, 05:46 PM
Hi hosein,

If you are using a DataSet to work with your data from database, you must save the changes using your SqlAdapter instance. In RadGridView after changing the SelectedItem of ComboBoxColumn you will change the TypeID value of Phones table and after that it is needed to save the data using the Update() method of your SqlAdapter. When the data is loaded the next time, the selected value in ComboBoxColumn must be properly loaded.

Here is a sample using Northwind database:

this.customersTableAdapter.Update(this.northwindDataSet.Customers);

I hope this was helpful.

Greetings,
Julian Benkov
the Telerik team
0
hosein
Top achievements
Rank 1
answered on 16 Feb 2011, 10:22 PM

Hello Julian

thanks for your reply.

i have found the solution.

Tags
GridView
Asked by
hosein
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
hosein
Top achievements
Rank 1
Share this question
or