排序radgridview的内容 [英] sort contents of the radgridview

查看:157
本文介绍了排序radgridview的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个代码可以根据名称(列)过滤数据网格的内容

Hi,
I have a code that filters the content of the datagrid based on the name(column)

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




我希望根据选定的radgridview上的单元格对其进行过滤.




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

Can you help me on this?

推荐答案

您可以使用GridView排序,http://msdn.microsoft.com/zh-CN/library/system.web.ui.webcontrols.gridview.sort.aspx [ ^ ]
You can use GridView sort, http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.sort.aspx[^]


您可能想访问RadGrid论坛.这段代码对我来说很好.
You might want to visit the RadGrid forums. This code looks fine to me.


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


这篇关于排序radgridview的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆