开发者

filtering contents of radgridview

开发者 https://www.devze.com 2023-02-27 00:58 出处:网络
i have a problem wit开发者_如何学运维h filtering th contents of my radgridview. here\'s my code

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消