Hi,
My requirement is to add a combobox in WPF Infragistic Grid (xamdatagrid) column. Could you please provide me an example for same.
Best Regards,
Ritesh.
Ritesh,
In order to get an instance of the editor in a cell, you have to get the CellValuePresenter for that cell:
CellValuePresenter.FromCell(...);
The CVP itself exposes an Editor property, which is the underlying value editor - i.e. XamComboEditor, XamTextEditor, etc.
Now, I could able to add combobox to XamDataGrid.
Could you explain me, how to find this combobox control in a XamDataGrid row, bind the datasource to combobox and to assign value to combobox.
Thanks,
Hello Ritesh,
You can use a XamComboEditor inside a cell, which is out of the box feature, enabled by setting the EditorStyle or EditorType property of the Field's Settings. However, if it is a requirement for your to insert a ComboBox, then you would have to retemplate the CellValuePresenter. You can see an example of a similar thing (putting an image inside a cell) in the XamFeatureBrowser samples under XamDataGrid - Themes and Custom Styles - Embedded Image in Cells. All you need to do is change the Image to ComboBox and set its ItemsSource property.