I am trying to create a grid containing combo boxes, with RadComboBox's value bound to one table in a DataSet, while the items list comes from another table in the same DataSet. I thought this was supported, but I cannot find documentation on how to do it. If anyone can point me to the right documentation and examples, I would appreciate it.
Thanks
8 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 11 Feb 2009, 11:47 AM
Hi Peter,
From my understanding it is possible to bind the RadComboBox and Grid to two different DataTables. Here is an online demo where the combobox in the Grid is being populated from a DataTable. Check it out and let me know how it goes.
Combo in Grid
Thanks
Shinu
From my understanding it is possible to bind the RadComboBox and Grid to two different DataTables. Here is an online demo where the combobox in the Grid is being populated from a DataTable. Check it out and let me know how it goes.
Combo in Grid
Thanks
Shinu
0
Peter
Top achievements
Rank 1
answered on 11 Feb 2009, 01:39 PM
Hi,
I looked at the demo, and perhaps I'm not reading it right, but I'm not sure it addresses our issue. Here is what we want to do:
First, we want to bind the grid and combos in the code-behind using NeedDataSource. We have one tale, for example, an employee table that contains a column for "Department", and another table, "departments", that would contain "Accounting", "Sales", etc. Since both tables can be edited through the application, we don't want to try and populate the combo box items through the mark-up. Ideally we want to be able to set the grid's data source to a DataSet object that contains both tables (employee and departments), and have the selected value for the combo taken from the employee table, while the list of items for the dropdown come from the other table.
I hope I am explaining this clearly.
Peter
I looked at the demo, and perhaps I'm not reading it right, but I'm not sure it addresses our issue. Here is what we want to do:
First, we want to bind the grid and combos in the code-behind using NeedDataSource. We have one tale, for example, an employee table that contains a column for "Department", and another table, "departments", that would contain "Accounting", "Sales", etc. Since both tables can be edited through the application, we don't want to try and populate the combo box items through the mark-up. Ideally we want to be able to set the grid's data source to a DataSet object that contains both tables (employee and departments), and have the selected value for the combo taken from the employee table, while the list of items for the dropdown come from the other table.
I hope I am explaining this clearly.
Peter
0
Peter
Top achievements
Rank 1
answered on 17 Feb 2009, 01:27 PM
I could still use some advice on how to accomplish this. Please see my previous post.
Thanks
Thanks
0
Hello Peter,
RadComboBox can be bound automatically to one DataTable at time. So, you can set the Text property of the combo items based on one column of the dataTable and the Value property based on the values of another column by using DataTextField and DataValueField properties. The standard DropDownList works the same way.
What you can do is the following: let the datasource contains a single DataTable created by a join between the two tables (Employee and Departments). So, this datatable will have the needed columns of both tables (e.g. EmployeeID, DepartmentID, EmployeeName, DepartmentName, etc) and now you can set the DataTextField and DataValueField (and SelectedValue property) to the appropriate data fields.
If you experience any problems - please open a support ticket and attach a sample and running project there. We will check it and find a working solution for you.
Kind regards,
Veselin Vasilev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
RadComboBox can be bound automatically to one DataTable at time. So, you can set the Text property of the combo items based on one column of the dataTable and the Value property based on the values of another column by using DataTextField and DataValueField properties. The standard DropDownList works the same way.
What you can do is the following: let the datasource contains a single DataTable created by a join between the two tables (Employee and Departments). So, this datatable will have the needed columns of both tables (e.g. EmployeeID, DepartmentID, EmployeeName, DepartmentName, etc) and now you can set the DataTextField and DataValueField (and SelectedValue property) to the appropriate data fields.
If you experience any problems - please open a support ticket and attach a sample and running project there. We will check it and find a working solution for you.
Kind regards,
Veselin Vasilev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Peter
Top achievements
Rank 1
answered on 17 Mar 2009, 07:54 PM
Do you have another example of combo boxes in a grid, but using the NeedDataSource event? I need to do advanced data binding and also have a grid filled with combo boxes (that are always combo boxes, so they will be template columns.)
Thanks,
Peter
0
Peter
Top achievements
Rank 1
answered on 19 Mar 2009, 12:17 PM
Is anyone going to respond to this? I could really use the help here. This is related to a critical application conversion project at our company.
Thanks,
Peter
0
Hello Peter,
Please prepare a simple runnable project demonstrating the scenario and explain in details exact requirements. You should open a support ticket in order to be able to send us files. Thank you in advance.
All the best,
Yana
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Please prepare a simple runnable project demonstrating the scenario and explain in details exact requirements. You should open a support ticket in order to be able to send us files. Thank you in advance.
All the best,
Yana
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Peter
Top achievements
Rank 1
answered on 20 Mar 2009, 01:13 PM
I have submitted a support ticket and a small runnable project. The project shows what we would like to do but does not do the binding properly (but I am sure you can figure out what we are trying to do.) Basically we want to have a grid filled with combo boxes that the user can make selections from.
Peter
Peter