I'm a XamDataGrid with un unbound combobox column, and the ItemsSource is filled dynamically using linq.
Everything it's ok, but I must to pre-select the first item of the comboboxEditor, something like
cboXX.SelectedIndex = 0;
But I can't found how to do it with the combobox column / editor.
Any ideas?
Marcos
Hello Marcos,
Here is one way to do this:(I do this in the Click event of a button)
foreach (DataRecord record in xamDataGrid1.Records) { CellValuePresenter cvp = CellValuePresenter.FromCell(record.Cells[INDEX]); XamComboEditor editor = cvp.Editor as XamComboEditor; editor.SelectedIndex = 0; }
Hope this helps,
Alex.
Thanks a lot Alex, it's exactly what I was looking for.