wpf treeview get selected value -
i have treeview
, listbox
. both of them populated different datatable
s.
the treeview
gets data from:
datatable product_type = new datatable(); product_type.columns.add(new datacolumn("id_product_type", typeof(int))); product_type.columns.add(new datacolumn("name", typeof(string))); product_type.columns.add(new datacolumn("id_parent",typeof(int))); ds.tables.add(product_type);
the parent child relation:
ds.relations.add(new datarelation("rsparentchild", product_type.columns["id_product_type"], product_type.columns["id_parent"]));
so want the id_product_type treeview on selecteditemchanged , pass listbox, how actual value, int?
tht's looking for(i used dataview bind list) :
private void tlstview_selecteditemchanged(object sender, routedpropertychangedeventargs<object> e) { int new_value =(int)((datarowview)e.newvalue).row["id_product_type"]; }
Comments
Post a Comment