Kishore Kumar
Kishore Kumar

Reputation: 12874

ComboBox in a DataGrid Cell in WPF MVVM

I am working on a WPF MVVM Project.

Now i have a DataGrid in which i want this.

When ever the user comes to the FirstColumn of the DataGrid the Cell should be transformed into ComboBox and when user goes out of that cell the ComboBox should disappear and ComboBox selected value to the CellText.

How can i do that.

Only the selected Cell in the first column should have ComboBox

Upvotes: 0

Views: 1724

Answers (1)

ColinE
ColinE

Reputation: 70142

You will find this much easier if you use a DataGrid rather than a GridView. The DataGrid has the concept of CellTemplates and CellEditingTemplates built in, which make it very easy to render an edit control whilst the user is editing the cell.

Oh yes, and it has a combo-box column type, DataGridComboBoxColumn.

Upvotes: 3

Related Questions