wpf treeview get selected value -


i have treeview , listbox. both of them populated different datatables.

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

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -