I have designed a Gridview chich has a datasource and contains 2 combobox columns.
the first combobox column is for Department, ValueMember=ID and DisplayMember = Name.
The second combobox column is for operations, valuemmember=id and displaymember=operation.
no what happenes, when the gridview is loaded, the department combobox and operations combobox both are filled with all the values,
i want to fill the Operations Combobox Column based on the value of the Department combobox column.
How to achieve this?
Thanks in Advance.
10 Answers, 1 is accepted
Please take a look at this forum post which describes this scenario and has an example project attached.
Hope that helps
Richard
how did this go? If it helped, please remember to mark as answer.
Thanks
Richard
Hi,
I have three column in my Rad gridview.1st and 2 nd columns are Text box column 3 rd column is GridViewComboBoxColumn.i need to add items in combobox in dynamically based on some condition.for example if the first cell value is "String1" means the combo box items would be three value.if cell value is "string2" means the combo box items values are 4 values.how we can proceed with telerik grid.
Thanks in advance
Jegan.
Thank you for writing.
You can subscribe to the CellEditorInitialized event and in the handler, bind the RadDropDownListEditor to whatever data source you want to display. Please check the following documentation article: http://docs.telerik.com/devtools/winforms/gridview/editors/handling-editors'-events.
Additionally, you can check our cascading combo boxes example: http://www.telerik.com/support/kb/winforms/gridview/details/cascading-comboboxes-in-radgridview.
I hope this helps. Should you have further questions please do not hesitate to write back.
Regards,
Hristo
Progress Telerik
Thank you for your reply Hristo's.hope this helpful!.
Jegan
How can i did this with database?
Actually i want to populate data from database table in GridViewComboBoxColumn.
It shows empty GridViewComboBoxColumn.
Thank you for writing.
When binding RadGridViewComboBox column it is important to set the ValueMember and DisplayMember properties of the column. They need to be present on your data source object. Detailed information is available here: http://docs.telerik.com/devtools/winforms/gridview/columns/column-types/gridviewcomboboxcolumn.
I hope this helps. Should you have further questions please do not hesitate to write back.
Regards,
Hristo
Progress Telerik
I am doing the same process as you defined,
but combobox shows empty and when i click on it will displayed error as ..
" An unhandled exception of type 'System.FormatException' occurred in Telerik.WinControls.GridView.dll "
Thank you for writing back.
We are not aware of a similar issue. You can test with the attached sample project which properly populates the GridViewComboBoxColumn.
In case you keep experiencing issues please open a support ticket and send us your project.
I hope this helps. Should you have further questions please do not hesitate to write back.
Regards,
Hristo
Progress Telerik