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

Posted by Vikas227 under WPF on 2/17/2011 | Points: 10 | Views : 4149 | Status : [Member] | Replies : 2
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

<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;




Responses

Posted by: Naimishforu on: 2/17/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Please provide the proper source code.

Thanks,
Naimish
http://dotnetinterview.zxq.net/
http://naimishpandya.blogspot.in/

Vikas227, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naimishforu on: 2/17/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Meanwhile you can try below one also :

      <tk:DataGridTextColumn Header="Sample Column Header">

<tk:DataGridTextColumn.HeaderStyle>
<Style TargetType="{x:Type tk:DataGridColumnHeader}">
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Border Background="Red" Width="12" Height="12" />
<TextBlock Text="{Binding}" />
</StackPanel>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</tk:DataGridTextColumn.HeaderStyle>
</tk:DataGridTextColumn>


Thanks,
Naimish
http://dotnetinterview.zxq.net/
http://naimishpandya.blogspot.in/

Vikas227, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response