Adding new entries with a ComboBoxColumn

1 posts, 0 answers
  1. Mrn
    Mrn avatar
    29 posts
    Member since:
    Apr 2011

    Posted 27 Oct 2011 Link to this post


    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...

Back to Top