Ejemplo n.º 1
0
        private void btnAdd_Click_1(object sender, EventArgs e)
        {
            FormDemoAdd formDemoAdd = new FormDemoAdd();

            formDemoAdd.RefeshParentWindow = BtnRefesh_ParentWindow;
            DialogUtil.ShowDialog(formDemoAdd, this, 883, 519, new FormWindowProp(false, false, FormBorderStyle.FixedSingle));
        }
Ejemplo n.º 2
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")
                {
                    FormDemoAdd formDemoAdd = new FormDemoAdd(listData[e.RowIndex]);

                    DialogUtil.ShowDialog(formDemoAdd, this, formDemoAdd.Width, formDemoAdd.Height, null);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }