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

GridView cell spesific dynamic combo box editor

1 Answer 36 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Vesa
Top achievements
Rank 1
Vesa asked on 15 Nov 2012, 02:10 PM
Hi,

I should implement a dynamic combobox to be WPF gridviews cell editor. I need to create the combobox to some specific cell (for example to row 3 and column 2). The data should get from database in moment the user is activating the cell editing.

Already i found examples how to create GridViewComboBoxColumn, but i need to do this to just one cell at the time and the data must be fetched from relational database dynamic. That is because the data can be updated to the database at any time by other user/process.

What to do next?

1 Answer, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 15 Nov 2012, 02:38 PM
Hello,

I am a bit confused by your statement " The data should get from database in moment the user is activating the cell editing. " I am not sure do you mean data for the whole GridView, the ItemsSource for the ComboBox or the actual value of the cell .

Now a possible solution :

Place a ComboBox in the CellEditTemplate of the column. This would show the combo only in one cell - the one currently being edited.

You can handle the loaded event of the combo box in order to fetch your data from the database.

Kind regards,
Pavel Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Vesa
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Share this question
or