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

RadComboboxElement change datasource does not work

2 Answers 129 Views
GridView
This is a migrated thread and some comments may be shown as answers.
DGPunkt
Top achievements
Rank 1
DGPunkt asked on 18 Jan 2010, 03:36 PM

Hello everybody,

we are using RadControls for WinForms Q3 2009 SP1 and want to change the items of a ComboboxColumns editor by the value of the cell of another column.

For this in GridView.CellBeginEdit we set the editors element to the filtered datasource and expected the Comboxbox just to show the items of the filtered datasource BUT it shows all items of the original unfiltered datasource.

RadComboBoxEditor editor = m_gridView.ActiveEditor as RadComboBoxEditor;
if (null != editor)
{
   ((RadComboBoxElement)(editor.EditorElement)).DataSource = filteredDataSource;
}

Did we make a mistake or is it just a bug???

Greetings from Berlin, Germany

Daniel

2 Answers, 1 is accepted

Sort by
0
DGPunkt
Top achievements
Rank 1
answered on 21 Jan 2010, 09:41 AM
Hello?!?!?

Has anybody any suggestions???

Daniel
0
Nikolay
Telerik team
answered on 21 Jan 2010, 01:29 PM

Hi DGPunkt,

Thank you for the question.

The CellBeginEdit event is fired before the moment the DataSource of the GridViewComboBoxColumn is assigned to the RadComboBoxEditor. Therefore, your setting is overridden by the default DataSource of the GridViewComboBoxColumn.

In order to assign a custom DataSource to the RadComboBoxEditor, you should use the CellEditorInitialized event, because it is fired after the default RadComboBoxEditor initializations take place.

I am attaching a sample project which demonstrates the approach. I hope that it will help you in your further development.

In case you need a quicker response, please use our support ticketing system. Support tickets have higher priority than the forum threads and they are reviewed according to the license that you have. Thank you for your understanding.

Best wishes,

Nikolay
the Telerik team

 


Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
DGPunkt
Top achievements
Rank 1
Answers by
DGPunkt
Top achievements
Rank 1
Nikolay
Telerik team
Share this question
or