0
Answer

How to add sorting,searching and filtering in component art Wpf grid

vikas gupta

vikas gupta

13y
3.2k
1
i have added all property for search,filter and sorting on component art grid but these functionality is not working.how can i run these functionality?

i m designing a menu(this is not context menu) for sorting.grouping an show column of grid.i want to confirm is there any inbuilt compatibility between  menu and grid or i have to do code for that
 <my1:Menu Height="43" Grid.Row="1"  Name="menu1"  VerticalAlignment="Top" Width="auto" Margin="0,0,0,0" HorizontalAlignment="Stretch">

          <my1:MenuItem Text="Browse">
            <my1:MenuItem Text="All search"/>
                   </my1:MenuItem>
          <my1:MenuItem Text="Group">
            <my1:MenuItem Text="1st Column" >
              <my1:MenuItem Text="Name"/>
              <my1:MenuItem Text="Age"/>
              <my1:MenuItem Text="Date"/>
              <my1:MenuItem Text="Salary"/>
            </my1:MenuItem>
            <my1:MenuItem Text="2nd Column">
             <my1:MenuItem Text="Name"/>
              <my1:MenuItem Text="Age"/>
              <my1:MenuItem Text="Date"/>
              <my1:MenuItem Text="Salary"/>
            </my1:MenuItem>
            <my1:MenuItem Text="3rd Column">
           <my1:MenuItem Text="Name"/>
              <my1:MenuItem Text="Age"/>
              <my1:MenuItem Text="Date"/>
              <my1:MenuItem Text="Salary"/>
            </my1:MenuItem>
            <my1:MenuItem Text="Clear Grouping"/>
          </my1:MenuItem>
          <my1:MenuItem Text="Sort">
            <my1:MenuItem Text="1st Column">
             <my1:MenuItem Text="Name"/>
              <my1:MenuItem Text="Age"/>
              <my1:MenuItem Text="Date"/>
              <my1:MenuItem Text="Salary"/>
            </my1:MenuItem>
            <my1:MenuItem Text="2nd Column">
              <my1:MenuItem Text="Name"/>
              <my1:MenuItem Text="Age"/>
              <my1:MenuItem Text="Date"/>
              <my1:MenuItem Text="Salary"/>
            </my1:MenuItem>
            <my1:MenuItem Text="3rd Column">
            <my1:MenuItem Text="Name"/>
              <my1:MenuItem Text="Age"/>
              <my1:MenuItem Text="Date"/>
              <my1:MenuItem Text="Salary"/>
            </my1:MenuItem>
            <my1:MenuItem Text="Clear Sorting"/>
          </my1:MenuItem>
          <my1:MenuItem Text="Show">
            <my1:MenuItem Text="Name"/>
              <my1:MenuItem Text="Age"/>
              <my1:MenuItem Text="Date"/>
              <my1:MenuItem Text="Salary"/>
          </my1:MenuItem>
        </my1:Menu>
        <xmlgrd:DataGrid Name="Searchkeyword" VerticalAlignment="Top" Margin="0,0,20,0" Grid.Row="2" AllowSorting="True" SearchBoxVisibility="Visible" AllowPaging="False" ShowColumnFilters="True" ScrollBar.Scroll="Grid_Scroll" >
          <xmlgrd:DataGrid.Columns>
            <xmlgrd:DataGridTextColumn Header="Name" Width="200" Binding="{Binding name}" AllowSearching="True" ShowFilter="True" AllowSorting="True" AllowGrouping="True" />
            <xmlgrd:DataGridTextColumn Header="Age" Width="100" Binding="{Binding age}" AllowSearching="True" ShowFilter="True" AllowSorting="True" AllowGrouping="True"/>
            <xmlgrd:DataGridTextColumn Header="Date" Width="100" Binding="{Binding Date}" AllowSearching="True" ShowFilter="True" AllowSorting="True" AllowGrouping="True"/>
            <xmlgrd:DataGridTextColumn Header="Salary" Width="100" Binding="{Binding salary}" AllowSearching="True" ShowFilter="True" AllowSorting="True" AllowGrouping="True"/>
          </xmlgrd:DataGrid.Columns>
        </xmlgrd:DataGrid>

 Searchkeyword.ItemsSource = dtSerachKeyword.DefaultView;


I want to run this menu functioality with grid....
please reply....