zoukankan      html  css  js  c++  java
  • GridControl 分组排序

    方法一:纯代码

    this.list.gridControl.ItemsSource = lsItem;
    
                    this.list.gridControl.GroupBy("GroupTitle");
                    this.list.gridControl.Columns["GroupTitle"].SortOrder = ColumnSortOrder.Descending;
                    //this.list.gridControl.SortBy(this.list.gridControl.Columns["GroupTitle"], ColumnSortOrder.Descending);
    
                    this.list.gridControl.ExpandAllGroups();

    方法二:XAML定义,构造函数中绑定

    实时分组(先取消之前的分组)

     private void ListGrouping(string strType)
            {
                if (string.IsNullOrEmpty(strType)) return;
    
                if (strType == "Room")
                {
                    //ColumnView.SortInfo
                    this.list.gridControl.SortInfo.Clear();//clear grouping
                    this.list.gridControl.GroupBy("RoomName");
                    this.list.gridControl.Columns["RoomName"].SortOrder = ColumnSortOrder.Ascending;
    
                    this.list.gridControl.ExpandAllGroups();
     
                }
                else if (strType == "Status")
                {
                    this.list.gridControl.SortInfo.Clear();//Clear grouping
                    this.list.gridControl.GroupBy("Status");
                    this.list.gridControl.Columns["Status"].SortOrder = ColumnSortOrder.Ascending;
    
                    this.list.gridControl.ExpandAllGroups();
                }
     
            }
  • 相关阅读:
    Jackson Annotation Examples
    Java 8 Stream API说明
    Spring Enable* 注解
    1568: [JSOI2008]Blue Mary开公司
    BZOJ1558: [JSOI2009]等差数列
    BZOJ3155: Preprefix sum
    BZOJ4552 [Tjoi2016&Heoi2016]排序
    BZOJ4653 [Noi2016]区间
    BZOJ4487 [Jsoi2015]染色问题
    Luogu2664 树上游戏
  • 原文地址:https://www.cnblogs.com/quietwalk/p/3531646.html
Copyright © 2011-2022 走看看