I'm fairly new at working with datagrids and this problem is bugging the hell out of me. Can someone please lead me in the right direction as to how to prevent a user from double clicking a column header. The following code reflects what is supposed to happen when the user double clicks the grid,but i get a massive error when people double click on the column headers:
CellToDelete = dtgFE1.Rows[e.RowIndex].Cells[0].FormattedValue .ToString();
string Message = "Do you want to delete this record?";
string caption = "Notice";
DialogResult result;
result = MessageBox.Show (Message, caption, MessageBoxButto ns.OKCancel, MessageBoxIcon. Information);
if (result == DialogResult.OK )
{
SystemDeleteRec ord();
}
if (dtgFE1.DataSou rce != null)
{
dtgFE1.DataSour ce = RetrieveDataGri dsData.GetFEDat a1();
dtgFE1.DataMemb er = "System";
}
else
{
MessageBox.Show ("There are no more records associated with this call");
}
Any help would absutely be appreciated.
Thanks in advance.
CellToDelete = dtgFE1.Rows[e.RowIndex].Cells[0].FormattedValue .ToString();
string Message = "Do you want to delete this record?";
string caption = "Notice";
DialogResult result;
result = MessageBox.Show (Message, caption, MessageBoxButto ns.OKCancel, MessageBoxIcon. Information);
if (result == DialogResult.OK )
{
SystemDeleteRec ord();
}
if (dtgFE1.DataSou rce != null)
{
dtgFE1.DataSour ce = RetrieveDataGri dsData.GetFEDat a1();
dtgFE1.DataMemb er = "System";
}
else
{
MessageBox.Show ("There are no more records associated with this call");
}
Any help would absutely be appreciated.
Thanks in advance.