Exemple #1
0
        void CellEditorManager_ActivatingControl(object sender, Xceed.Grid.Editors.CellEditorEventArgs e)
        {
            //throw new Exception("The method or operation is not implemented.");
            //gridControl1.get

            int id = (int)(e.Cell.ParentRow.Cells["ID"].Value);
            //e.Control.Tag = o;

            TriggerValue      val    = mParentTriggerNamespace.GetValues()[id];
            VarValueBinder    binder = new VarValueBinder(val, val);
            HighLevelProperty HLProp = TriggerSystemMain.mTriggerDefinitions.GetHLProperty(binder, mParentTriggerNamespace);
            string            bindName;
            Control           c = HLProp.GetEditor(out bindName);

            Form f = new Form();

            f.Controls.Add(c);
            c.Dock     = DockStyle.Fill;
            f.Location = (new Point(0, 0));
            f.Text     = binder.GetName();
            f.Show();

            //e.Cell. = c;
            //e.Control = c;
        }
Exemple #2
0
        void cell_Click(object sender, EventArgs e)
        {
            Xceed.Grid.DataCell cell = sender as Xceed.Grid.DataCell;

            int id = (int)(cell.ParentRow.Cells["ID"].Value);

            if (mEditorforms.ContainsKey(id))
            {
                mEditorforms[id].BringToFront();
            }
            else
            {
                TriggerValue      val    = mParentTriggerNamespace.GetValues()[id];
                VarValueBinder    binder = new VarValueBinder(val, val);
                HighLevelProperty HLProp = TriggerSystemMain.mTriggerDefinitions.GetHLProperty(binder, mParentTriggerNamespace);
                string            bindName;
                Control           c = HLProp.GetEditor(out bindName);
                //this.TemplateControl = c;
                //this.TemplateControl

                Form f = new Form();


                f.Tag = id;


                f.Controls.Add(c);
                c.Dock = DockStyle.Fill;
                f.Text = binder.GetName();
                //f.TopLevelControl = true;
                f.Size = new Size(200, 55);

                Point p1 = new Point(0, 0);
                Point p2 = cell.PointToScreen(p1);
                f.StartPosition = FormStartPosition.Manual;
                p2.Y           -= 30;
                p2.X           -= 60;
                f.Location      = p2;
                //f.Init(this, mVariable, mValue, mHLProp);
                //f.FormClosed += new FormClosedEventHandler(f_FormClosed);
                //f.Show();
                f.FormClosed += new FormClosedEventHandler(f_FormClosed);

                f.TopMost = true;
                f.Show();

                mEditorforms[id] = f;
            }
        }