Avatar of thecruz
thecruz
 asked on

DatagridView Column Double Click

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, MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
if (result == DialogResult.OK)
{
SystemDeleteRecord();
}
if (dtgFE1.DataSource != null)
{
dtgFE1.DataSource = RetrieveDataGridsData.GetFEData1();
dtgFE1.DataMember = "System";
}
else
{
MessageBox.Show("There are no more records associated with this call");
}

Any help would absutely be appreciated.

Thanks in advance.
C#

Avatar of undefined
Last Comment
thecruz

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
jandromeda

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
thecruz

ASKER
Thanks bud.  That solved my problem.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes