Ejemplo n.º 1
0
    public GridColsCollection SortableColumns()
    {
        GridColsCollection sColumns = new GridColsCollection();

        foreach (GridColsColumn sColumn in _Columns)
        {
            if (sColumn.CanSort == true)
            {
                sColumns.Add(sColumn.ColumnName, sColumn.DisplayName, sColumn.Visible, sColumn.CanSort);
                sColumns.Item(sColumns.Count - 1).ColumnIndex = sColumn.ColumnIndex;
                sColumns.Item(sColumns.Count - 1).Viewable    = sColumn.Viewable;
            }
        }
        return(Columns);
    }
Ejemplo n.º 2
0
    public GridColsCollection VisibleColumns()
    {
        GridColsCollection columns = new GridColsCollection();
        GridColsColumn     gcc     = null;

        for (int i = 0; i <= _Columns.Count; i++)
        {
            gcc = _Columns.ItemByColumnOrder(i);
            if ((gcc == null) == false && gcc.Visible == true)
            {
                columns.Add(gcc.ColumnName, gcc.DisplayName, gcc.Visible, gcc.CanSort);
                columns.Item(columns.Count - 1).ColumnIndex = gcc.ColumnIndex;
                columns.Item(columns.Count - 1).Viewable    = gcc.Viewable;
            }
        }

        return(columns);
    }
Ejemplo n.º 3
0
    public GridColsCollection CurrentOrderedColumns()
    {
        GridColsCollection oColumns = new GridColsCollection();

        for (int i = 0; i < _Columns.Count; i++)
        {
            GridColsColumn testColumn = _Columns.ItemByColumnOrder(i);
            if ((testColumn == null) == false)
            {
                if (testColumn.CanReorder == true & testColumn.Viewable == true)
                {
                    oColumns.Add(testColumn.ColumnName, testColumn.DisplayName, testColumn.Visible, testColumn.CanSort);
                    oColumns.Item(oColumns.Count - 1).ColumnIndex = testColumn.ColumnIndex;
                    oColumns.Item(oColumns.Count - 1).Viewable    = testColumn.Viewable;
                }
            }
        }
        return(oColumns);
    }
Ejemplo n.º 4
0
    public void UpdateForcedColumns()
    {
        for (int i = 0; i < _ForcedVisibleColumns.Length; i++)
        {
            try
            {
                _Columns.ItemByColumnName(_ForcedVisibleColumns[i]).Viewable = true;
                _Columns.ItemByColumnName(_ForcedVisibleColumns[i]).Visible  = true;
            }
            catch (Exception ex)
            {
            }
        }
        for (int i = 0; i < _Columns.Count; i++)
        {
            bool canChange = false;
            for (int y = 0; y < _AvailableForcedColumns.Length; y++)
            {
                if (_Columns.Item(i).ColumnName == _AvailableForcedColumns[y])
                {
                    canChange = true;
                    break;                     // TODO: might not be correct. Was : Exit Do
                }
            }
            if (canChange == true)
            {
                bool columnExists = false;
                for (int y = 0; y < _ForcedVisibleColumns.Length; y++)
                {
                    if (_Columns.Item(i).ColumnName == _ForcedVisibleColumns[y])
                    {
                        columnExists = true;
                        break;                         // TODO: might not be correct. Was : Exit Do
                    }
                }

                if (columnExists == false)
                {
                    _Columns.Item(i).Visible = false;
                }
            }
        }
    }