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

Populate GridViewMultiComboBoxColumn with Dataset

3 Answers 75 Views
GridView
This is a migrated thread and some comments may be shown as answers.
ISB-developer
Top achievements
Rank 2
ISB-developer asked on 07 Nov 2011, 09:04 PM
Is it possible to populate a column from a radGridView that has type RadGridMultiComboBoxColumn with a Dataset?
I want to fill each cell on event 'BeginEdit' and clear on EndEdit event
Can somebody help me?
Thanks

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 10 Nov 2011, 12:55 PM
Hello Isb-Developer,

Thank you for writing.

You can bind GridViewMultiComboBoxColumn to a table from the DataSet and not the DataSet itself. Simply set the DataSource property of the column to the dataset table, and set the display and value members:
GridViewMultiComboBoxColumn col = new GridViewMultiComboBoxColumn();
col.DataSource = set.Tables[0];
col.DisplayMember = "Name";
col.ValueMember = "ID";

Then on CellBeginEdit, you can fill any data to the table that the column is bound to.

I hope that you find this information helpful. Should you have any other questions, do not hesitate to contact us.
 
Kind regards,
Stefan
the Telerik team

Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

0
ISB-developer
Top achievements
Rank 2
answered on 10 Nov 2011, 01:18 PM
Yes I have understand. But is it possible to bind each cell from one GridViewMultiComboBoxColumn (GVMCBC) individually to a table from a dataset?
So, let's say I have only one column with type GVMCBC and I want different values for the dropdown list values.
For example for first cell I need to have three options (A, B, C) ; for next cell I need to have A, B, C, and D ; for other cell I need to have B and C. So, for each cell I need to create a dropdown list with different values.
Is it possible?
Or the only possibility is to bind the entire column to a table from a dataset?
0
Stefan
Telerik team
answered on 15 Nov 2011, 11:38 AM
Hello Isb-Developer,

It is possible to bind each cell individually. Such functionality is described in the following Knowledge Base article for GridViewComboBoxColumn, but the same approach applies to GridViewMultiComboBoxColumn with its RadMultiColumnComboBoxElement editor. Attached you can find a sample demo application with the desired functionality.

I hope this helps.

Kind regards,
Stefan
the Telerik team

Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

Tags
GridView
Asked by
ISB-developer
Top achievements
Rank 2
Answers by
Stefan
Telerik team
ISB-developer
Top achievements
Rank 2
Share this question
or