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

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

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