Ejemplo n.º 1
0
        private void OnHeaderContextMenuClick(object sender, EventArgs eventArgs)
        {
            if (sender as MenuItem == null)
            {
                return;
            }

            MenuItem mi   = sender as MenuItem;
            ColParam colP = mi.Tag as ColParam;

            if (!colParams.Any(x => x.Value.Visible && x.Value.IsKeyField) && colParams.Count(x => x.Value.Visible) == 1 && colP.Visible)
            {
                return;
            }

            Save();
            colP.Visible = !(sender as MenuItem).Checked;
            if (colP.Visible)
            {
                colParams.Where(x => x.Value.Index >= (int)mi.Parent.Tag + 1).Select(x => x.Value.Index++).ToArray();
                colP.Index = (int)mi.Parent.Tag + 1;
            }

            colParams.Save();
            ReloadData();
        }
Ejemplo n.º 2
0
 public void LoadValuesFrom(ColParam colParam)
 {
     Name       = colParam.Name;
     HeaderName = colParam.HeaderName;
     Index      = colParam.Index;
     Width      = colParam.Width;
     Visible    = colParam.Visible;
     DataType   = colParam.DataType;
 }