c# - Binding data grid values to another data grid -
i have 2 datagrids. first contains columns:
name, price, rank, rating, groupnumber ..... , many other columns and second contains:
name, rating, groupnumber suppose selected row in first datagrid , row groupnumber 6, there way display rows groupnumer=6 using data binding in second datagrid?
what best way such thing?
right doing selecting rows have same group number selected row in first grid copying rows datatable setting source of second grid.
here how doing right on row selection changed first grid:
int gnum = //get selected row gnum value secondgrid.itemssource = firstgrid.select(string.format("gnum={0}", gnum)).copytodatatable().defaultview;
you can bind same source both datagrids, in second 1 use filter based on current row in first datagrid
Comments
Post a Comment