Ejemplo n.º 1
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         ColumnHeaderLLMenu.Dispose();
         DisposeFMContextMenu();
     }
     base.Dispose(disposing);
 }
Ejemplo n.º 2
0
        internal void SetColumnData(List <ColumnData> columnDataList)
        {
            if (columnDataList.Count == 0)
            {
                return;
            }

            #region Important

            // Do not remove! DataGridViewColumn.DisplayIndex changes the DisplayIndex of other columns when you
            // set it. That means we can't step through columns in order and set their DisplayIndex to whatever
            // it should be; instead we have to step through DisplayIndexes in order and assign them to whatever
            // column they should be assigned to.

            // Wrong:
            // Column[0].DisplayIndex = 4; Column[1].DisplayIndex = 12; etc.

            // Right:
            // Column[10].DisplayIndex = 0; Column[3].DisplayIndex = 1; etc.

            columnDataList = columnDataList.OrderBy(x => x.DisplayIndex).ToList();

            #endregion

            foreach (ColumnData colData in columnDataList)
            {
                DataGridViewColumn col = Columns[(int)colData.Id];

                col.DisplayIndex = colData.DisplayIndex;
                if (col.Resizable == DataGridViewTriState.True)
                {
                    col.Width = colData.Width;
                }
                MakeColumnVisible(col, colData.Visible);

                ColumnHeaderLLMenu.SetColumnChecked((int)colData.Id, colData.Visible);
            }
        }
Ejemplo n.º 3
0
 internal void Localize()
 {
     ColumnHeaderLLMenu.SetMenuItemTextToLocalized();
     SetFMMenuTextToLocalized();
 }
Ejemplo n.º 4
0
 internal void SetContextMenuToColumnHeader()
 {
     ColumnHeaderLLMenu.Construct(this);
     ContextMenuStrip = ColumnHeaderLLMenu.GetContextMenu();
 }