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

ComboBox Data Source

5 Answers 186 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 04 May 2015, 08:42 PM

I have grid with four columns. On load, I'm getting the data from a single table to populate the columns in the grid. Imagine a data with a column for uniqueID, text, text, numbers and numbers. I'm loading just the last for as visible.

I want the user to have the ability to edit the first two columns. This data actually comes from another table. There may be five choices for the user to select.

I'm looking everywhere for en event and I cannot find where I can edit the data source for the combobox columns. I'm completely stumped as to how I can populate the drop down boxes with valid data for the user to select.

5 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 07 May 2015, 02:05 PM
Hello Chris,

Thank you for writing.

You can directly specify the GridViewComboBoxColumn.DataSource. If you set the ValueMember, DisplayMember properties you will set up the column on a way to display the desired values, but use another property/column from the DataSource for the value itself. Additionally, the GridViewComboBoxColumn.FieldName property gives you the opportunity to match the GridViewComboBoxColumn with a specific property from the RadGridView.DataSource. However, if you need to modify the available items in the GridViewComboBoxColumn later, it would be suitable to use the CellEditorInitialized  event and manipulate the editor's data source collection. 

If you are still experiencing any further difficulties, it would be greatly appreciated if you provide a sample code snippet which replicates the undesired result. Thus, we would be able to investigate the precise case and assist you further. Thank you.

I hope this information helps. Should you have further questions, I would be glad to help.
 
Regards,
Dess
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Chris
Top achievements
Rank 1
answered on 07 May 2015, 06:22 PM
On load, I'm just loading the grid with the dataset fill statement for the one table. The SQL table has five rows, but I only display four of them.

 

this.TableAdapter.Fill(this.DataSet.table);
DataSetTableAdapters.TableAdapter loadTable = new DataSetTableAdapters.TableAdapter();

 

This works great. The existing data is populated in the grid. The two columns I have that are comboboxes are at first populated with the data from the table. What I want is to have the the drop down populate with options from a different table.

What I think you're telling me is I have to use CellEditorInitialized to then populate the drop down list for that cell.

 

If so, can you point me to an example of that?

0
Chris
Top achievements
Rank 1
answered on 12 May 2015, 02:08 AM

I'm extremely disappointed in Telerik. I guess progress has fired everyone who used to answer questions here. I've been waiti9ng days for a response and frankly that's unacceptable.

The documentation for this co0ntrol is basically useless if you are doing real work.

 

I am very unhappy.

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 12 May 2015, 10:40 AM
Hello Chris,

Thank you for writing back.

Note that most of the forum threads are reviewed by Telerik representatives and we address the questions asked by our customers in the forums as well. Additionally, have in mind that the ticket response time for forum threads is 72 hours (work days).  Moreover threads are handled according to license and time of posting, so if it is an urgent problem, we suggest you use a support ticket, which would be handled before a forum thread. You can refer to our Support Plans for DevTools: http://www.telerik.com/purchase/support-plans/devtools.

As to the question related to GridViewComboBoxColumn, I have prepared a sample project demonstrating how to bind the column to a BindingSource and modify in the CellEditorInitialized event afterwards. 

I hope this information helps. If you have any additional questions, please let me know.
 
Regards,
Dess
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Tomas
Top achievements
Rank 2
Veteran
answered on 19 Nov 2020, 11:58 AM

Many thanks Dess, your sample project with CellEditorInitialized event example helped me in 2020.

Cheers,

Tomas

Tags
GridView
Asked by
Chris
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Chris
Top achievements
Rank 1
Tomas
Top achievements
Rank 2
Veteran
Share this question
or