wpf - DataTable filter: Get all the elements of the same group of the result -
i've filled datagrid datatable. can filter datatable rowfilter. search product , result. want other products in same group.
my code
<window x:class="window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="window1" height="129" width="124" loaded="window_loaded_1"> <grid> <datagrid x:name="testgrid" itemssource="{binding}" autogeneratecolumns="false" canuseraddrows="false"> <datagrid.columns> <datagridtextcolumn binding="{binding group}" header="group"/> <datagridtextcolumn binding="{binding product}" header="product"/> </datagrid.columns> </datagrid> </grid> </window> private sub window_loaded_1(sender object, e routedeventargs) 'create tabel dim table new datatable table.columns.add("group", gettype(string)) table.columns.add("product", gettype(string)) table.rows.add("group1", "printserver") table.rows.add("group1", "recupel") table.rows.add("group2", "docking") table.rows.add("group2", "monitor") 'set filter table.defaultview.rowfilter = "product '%monitor%'" 'fill datagrid testgrid.datacontext = table end sub here screenshots of need:
===>
how can datatable filter?
Comments
Post a Comment