Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have this routine that runs when the use clicks delete on a dgv row, but it keeps deleting the first row in the dgv no matter which row i have selected;

 

private void dgvDelays_UserDeletedRow(object sender, DataGridViewRowEventArgs e)
       {
           DataRowView selectedRow2 = (DataRowView)bindingDataDelays.Current;

           if (selectedRow2 == null)
           {
               return;
           }

           _delayID = Convert.ToInt32(selectedRow2["DelayID"]);

           DataRow[] currentRows2 = DataComponents.ShiftData.tblUnitDelays
                   .Select("DelayID = " + _delayID);

			foreach (ShiftDataSet.tblUnitDelaysRow row in currentRows2)
			{
                   row.Delete();
			}

               UpdateDelay();
       }

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...