Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
265
Cascade XamComboEditors in XamDataGrid
posted

Hi,

i am trying to use two dependant xamcomboeditors in xamdatagrid,first combo contains City kist and secod is county list depending on selected city on first combobox,and i use first combobox's selecteditemchange event to set county combo's itemssource for changed city.I can access the editor of county field with  :

(In first City xamcombo's selecteditemchanged routedevent)

DataRecord

 

 

record = grid.ActiveRecord as DataRecord;

CellValuePresenter presenter = CellValuePresenter.FromRecordAndField(record, "FieldName");

XamComboEditor editor = presenter.Editor as XamComboEditor;

by activerecord of grid and name of county field,and then update the itemssource of accessed editor.(County)

it's ok when user selects city on UI ,because i can get grid's activerecord,but can't get the editor of County when i set the city manually on codebehind.

Is there a way to get editor when grid's activerecord is null or is there a better way to use cascade xamcombobox in xamdatagrid and set the selected item ?