예제 #1
0
        private void SetSort(SortOrder sortOrder)
        {
            GridHeaderRow ghr         = (GridHeaderRow)Row;
            int           oldPriority = SortPriority;
            SortOrder     oldSort     = Sort;

            Sort = sortOrder;
            if (Sort == SortOrder.None)  // removing sorting from this column
            {
                SortPriority = -1;
                foreach (GridHeaderItem other in ghr.Items.Values)
                {
                    if (other != this && other.SortPriority > oldPriority)
                    {
                        other.SortPriority--;
                    }
                }
            }
            else if (oldSort == SortOrder.None)  // starting to apply sorting to this column
            {
                SortPriority = 0;
                foreach (GridHeaderItem other in ghr.Items.Values)
                {
                    if (other != this && other.SortPriority > -1)
                    {
                        other.SortPriority++;
                    }
                }
            }

            ghr.UpdateCompareOrder();
        }
예제 #2
0
        private bool PreviousUnsizable()
        {
            GridHeaderRow hr     = (GridHeaderRow)Row;
            int           tindex = hr.Columns.IndexOf(ColumnName);

            if (tindex <= 0)
            {
                return(true);
            }
            string       tother = hr.Columns[tindex - 1];
            GridItemBase prevItem;

            if (!hr.Items.TryGetValue(tother, out prevItem))
            {
                return(true);
            }
            GridHeaderItem prevHeader = prevItem as GridHeaderItem;

            if (prevHeader == null)
            {
                return(true);
            }
            return(prevHeader.UnSizable);
        }
예제 #3
0
        private void SetupHeaderRow()
        {
            GridHeaderRow = new GridHeaderRow(ROW_HEIGHT);

            foreach (string s in DEFAULT_COLUMNS)
                ShowColumn(s);

            SetHeaderRow(GridHeaderRow);
        }
예제 #4
0
 public void SetHeaderRow(GridHeaderRow hr)
 {
     hr.GridView = this;
 }
예제 #5
0
파일: GridView.cs 프로젝트: huizh/xenadmin
 public void SetHeaderRow(GridHeaderRow hr)
 {
     hr.GridView = this;
 }