Hi,
I have a DataGridView with checkbox columns.
There is also a button on the form to save the DataGridView data.
However, if the last thing I do in the DataGridView is check or uncheck then that action is ignored. i.e. it is not saved.
If I click elsewhere on the DGV then the checked item is recognised.
Any ideas why this might be?
Thanks.
code...
Code:
private void ISDataGridView_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e)
{
if (e.ColumnIndex == this.ISDataGridView.Columns["LaunchDateColumn"].Index)
{
this.InvestorServicesDateTimePicker.Location = this.ISDataGridView.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, true).Location;
this.InvestorServicesDateTimePicker.Size = this.ISDataGridView.CurrentCell.Size;
this.InvestorServicesDateTimePicker.Visible = true;
if (this.ISDataGridView.CurrentCell.Value != null)
{
try
{
this.InvestorServicesDateTimePicker.Value = (DateTime)this.ISDataGridView[e.ColumnIndex, e.RowIndex].Value;
}
catch (Exception ex)
{ }
}
}
}
private void ISDataGridView_CellEndEdit(object sender, DataGridViewCellEventArgs e)
{
if ((this.ISDataGridView.Focused) && (this.ISDataGridView.CurrentCell != null))
{
if (this.ISDataGridView.CurrentCell.ColumnIndex == 2)
{
this.ISDataGridView.CurrentCell.Value = InvestorServicesDateTimePicker.Text;
this.InvestorServicesDateTimePicker.Visible = false;
}
}
}