private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            DisplayField df = (DisplayField)gridMain.ListGridRows[e.Row].Tag;
            //OrthoChartTabFields orthoChartTabFields=GetSelectedFields();
            long orthoChartTabNum     = _listOrthoChartTabs[comboOrthoChartTabs.SelectedIndex].OrthoChartTabNum;
            OrthoChartTabLink linkCur = _listOrthoChartTabLinks.FirstOrDefault(x => x.OrthoChartTabNum == orthoChartTabNum &&
                                                                               x.DisplayFieldNum == df.DisplayFieldNum);
            bool isAddingNewLink = false;

            if (linkCur == null)           //Avoid thrown exception in FormDisplayFieldOrthoEdit_Load(...) when adding a new link and then attempting to edit it.
            {
                isAddingNewLink = true;
                linkCur         = new OrthoChartTabLink()
                {
                    OrthoChartTabNum = orthoChartTabNum,
                    //ItemOrder will be set when FormDisplayFieldsOrthoChart closes/syncs.
                    DisplayFieldNum     = df.DisplayFieldNum,
                    ColumnWidthOverride = 0,
                };
            }
            FormDisplayFieldOrthoEdit form = new FormDisplayFieldOrthoEdit(df, GetAllFields(), linkCur);

            form.ShowDialog();
            if (form.DialogResult != DialogResult.OK)
            {
                return;
            }
            if (isAddingNewLink)             //Do not add new link to list if user clicks cancel because we want to act like nothing happened
            {
                _listOrthoChartTabLinks.Add(linkCur);
            }
            FillGrids();
            changed = true;
        }
示例#2
0
        private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            DisplayField df = (DisplayField)gridMain.Rows[e.Row].Tag;
            FormDisplayFieldOrthoEdit form = new FormDisplayFieldOrthoEdit();

            form.ListAllFields = GetAllFields();
            form.FieldCur      = df;
            form.ShowDialog();
            if (form.DialogResult != DialogResult.OK)
            {
                return;
            }
            FillGrids();
            changed = true;
        }
        private void ListAvailable_DoubleClick(object sender, EventArgs e)
        {
            if (listAvailable.SelectedIndices.Count != 1)           //make sure only one is selected
            {
                return;
            }
            FormDisplayFieldOrthoEdit form = new FormDisplayFieldOrthoEdit(_listAvailableFields[listAvailable.SelectedIndices[0]], GetAllFields());

            if (form.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            FillGrids();
            changed = true;
        }