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

Adding new entries with a ComboBoxColumn

0 Answers 53 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mrn
Top achievements
Rank 1
Mrn asked on 27 Oct 2011, 03:02 PM
Hello,

I have a GridView with 3 custom columns, where the first one is a DataColumn and the last one is a ComboBoxColumn. I want the GridView to have just one row and the first cell directly on edit mode when loaded, what I achieve by calling gridView.BeginInsert() when the loaded event is raised. But this way I get an empty combo box in third column, because of course, at this point I haven't initialized the property the combo box is bound to.

What I'm trying to achieve is having a row where the first and second columns are empty and the third, the combo box, is populated, and having the edit-mode caret on the first column cell... so I thought it was possible to call gridView.BeginInsert() and then, when AddingNewDataItem event is raised, to access the object that is supposed to have been just created and to set values to the property bound to the combo box... but I get an empty gridView.Items collection. However, I can see the new row with the first cell on edit mode in the interface...

How could I achieve my goal? I also tried creating an object and setting values to its property and adding it to gridView.ItemsSource collection when the GridView is loaded instead of calling BeginInsert(), but I couldn't manage to set the first cell on edit mode programmatically...

Thanks!

No answers yet. Maybe you can help?

Tags
GridView
Asked by
Mrn
Top achievements
Rank 1
Share this question
or