filtering contents of radgridview
i have a problem wit开发者_如何学运维h filtering th contents of my radgridview.
here's my code
private void Filter_Click(object sender, System.Windows.RoutedEventArgs e) { FilterDescriptor filter = new FilterDescriptor("Name", FilterOperator.Contains, (RadGridView1.SelectedItem as Person).Name); RadGridView1.FilterDescriptors.Add(filter); }
it only filters the "Name" column. i want it to filter the data based on the value of the cell clicked... i have to get the column name of the cell clicked and replace it to "Name" in my code...
can anyone help me with this?
here's the code to filter:
FilterDescriptor filter = new FilterDescriptor(RadGridView1.CurrentCell.Column.UniqueName, FilterOperator.IsEqualTo, RadGridView1.CurrentCell.Value); RadGridView1.FilterDescriptors.Add(filter);
here's the code to remove filter:
RadGridView1.FilterDescriptors.Clear();
RadGridView1 is the name of the radgridview.
精彩评论