John Stagich's Blog

Microsoft .Net Developer

UserDeletingRow Event in Datagridview not Firing

clock April 27, 2010 06:59 by author johnstagich

I was developing a Windows Forms application that made use of the datagridview control.  I created a UserDeletingRow event handler that included a message box prompt warning the user that they were about to delete a row.  Initially, the UserDeletingRow event handler worked fine; however, after making some code changes to other parts of the code behind page for the form, the UserDeletingRow event stopped firing.  I checked the AllowUserToDeleteRows property for the datagridview and it was set to true.  I also checked the VirtualMode property and it too was set to true.

 

To make a long story short, it turns out the culprit was a comboBox.Focus() statement.  In my code, I added the comboBox.Focus() statement to a routine that executed in conjunction with a datagridview RowEnter event.  After commenting out the statement, the UserDeletingRow event resumed firing.

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


April 2010 Quick Hits

clock April 24, 2010 06:05 by author johnstagich
  • Resetting the value of an Identity column in T-SQL

DBCC CHECKIDENT (tablename, reseed, 7)  -- When you insert a row, the Identity column will have a value of 8.

SELECT CONVERT(DATETIME, CONVERT(CHAR(8), 20070824))

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Search

Calendar

<<  September 2010  >>
SuMoTuWeThFrSa
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789

Archive

Tags

Categories


Blogroll

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010

Sign in