示例#1
0
        public CustomDGVButtonColumn()
        {
            CustomDGVButtonCell obj = new CustomDGVButtonCell();

            this.CellTemplate = obj;
            CellTemplate      = new CustomDGVButtonCell();
        }
示例#2
0
        // Override the Clone method so that the Enabled property is copied.
        public override object Clone()
        {
            CustomDGVButtonCell cell = (CustomDGVButtonCell)base.Clone();

            cell.Enabled = Enabled;
            return(cell);
        }
示例#3
0
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex > -1)
            {
                CustomDGVButtonCell cell = (CustomDGVButtonCell)dataGridView1.Rows[e.RowIndex].Cells[1];

                if (e.ColumnIndex == 1 && cell.Enabled)
                {
                    try
                    {
                        MessageBox.Show(cell.Value.ToString());
                    }
                    catch { }
                }
            }
        }