How do I get the UIElement that represents a DataRecord/Datacell visually? (Similar to ItemContainerGenerator.ContainerFromItem)
Is there a way to get the list of xamDataGrid's currently generated containers?
Thanks
Anyone?
Hello,
I am assuming that you want to get the CellValuePresenter. You can do it with the CellValuePresenter class and the method FromRecordAndField You can also get an instance of the editor in the CellValuePresenter from the EditorType property.
Something like this:
DataRecord dr = xamDG.ActiveRecord as DataRecord; CellValuePresenter cvpCombo = CellValuePresenter.FromRecordAndField(dr, dr.FieldLayout.Fields[1]); CellValuePresenter cvpText = CellValuePresenter.FromRecordAndField(dr, dr.FieldLayout.Fields[0]); XamComboEditor ce = cvpCombo.Editor as XamComboEditor; XamTextEditor te = cvpText.Editor as XamTextEditor;
Hope this helps.
Alex.