Click here to Skip to main content
15,867,141 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have a code that filters the content of the datagrid based on the name(column)

C#
private void Filter_Click(object sender, System.Windows.RoutedEventArgs e)
{
    ilterDescriptor filter = new FilterDescriptor("Name", FilterOperator.Contains, (RadGridView1.SelectedItem as Person).Name);
    RadGridView1.FilterDescriptors.Add(filter);
}



I want it to be filtered based on the cell on the radgridview that is selected.

Can you help me on this?
Posted
Updated 14-Apr-11 21:31pm
v2

 
Share this answer
 
Comments
Member 7838027 15-Apr-11 9:27am    
thanks... in my code, the ones that can sorted are only numeric fields (ID(int) and UnitPrice(double)) not the name(string) and date (datetime)... can you help me?
You might want to visit the RadGrid forums. This code looks fine to me.
 
Share this answer
 
Comments
Sandeep Mewara 15-Apr-11 9:02am    
Comment from OP:
thanks... in my code, the ones that can sorted are only numeric fields (ID(int) and UnitPrice(double)) not the name(string) and date (datetime)... can you help me?
C#
private void Filter_Click(object sender, System.Windows.RoutedEventArgs e)
{
    FilterDescriptor filter = new FilterDescriptor(RadGridView1.CurrentCell.Column.UniqueName, FilterOperator.IsEqualTo, RadGridView1.CurrentCell.Value);
    RadGridView1.FilterDescriptors.Add(filter);
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900