Example #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();
        }
Example #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);
        }
Example #3
0
        private void SetupHeaderRow()
        {
            GridHeaderRow = new GridHeaderRow(ROW_HEIGHT);

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

            SetHeaderRow(GridHeaderRow);
        }
Example #4
0
 public void SetHeaderRow(GridHeaderRow hr)
 {
     hr.GridView = this;
 }
Example #5
0
 public void SetHeaderRow(GridHeaderRow hr)
 {
     hr.GridView = this;
 }