Пример #1
0
        private void ListDataGriddView_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.RowIndex < 0 || e.ColumnIndex < 0)
                {
                    return;
                }

                if (e.ColumnIndex == 0)
                {  //单选
                   //checkbox
                    if ((bool)listDataGriddView.Rows[e.RowIndex].Cells[0].EditedFormattedValue == true)
                    {
                        listDataGriddView.Rows[e.RowIndex].Cells[0].Value = false;
                    }
                    else
                    {
                        listDataGriddView.Rows[e.RowIndex].Cells[0].Value = true;
                    }
                }

                string columnName = listDataGriddView.Columns[e.ColumnIndex].Name;
                if (columnName == "detail_row")
                {
                    FormTemAdd itemForm = new FormTemAdd(codeProjectInfo, lists[e.RowIndex].ID);
                    DialogUtil.ShowDialog(itemForm, this, itemForm.Width, itemForm.Height, new Common.prop.FormWindowProp(false, false, FormBorderStyle.FixedDialog));
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #2
0
        private void AddBtn_Click(object sender, EventArgs e)
        {
            FormTemAdd formTemAdd = new FormTemAdd(codeProjectInfo, 0);

            DialogUtil.ShowDialog(formTemAdd, this, formTemAdd.Width, formTemAdd.Height, new Common.prop.FormWindowProp(false, false, FormBorderStyle.FixedDialog));
        }