John Stagich's Blog

Microsoft .Net Developer

UserDeletingRow Event in Datagridview not Firing

clock April 27, 2010 12: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.

 



April 2010 Quick Hits

clock April 24, 2010 12: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))



About the author

I am the owner of Stagich Software Consulting.  Stagich Software Consulting specializes in developing Microsoft .Net/Microsoft SQL software applications.

 

Calendar

<<  December 2024  >>
MoTuWeThFrSaSu
2526272829301
2345678
9101112131415
16171819202122
23242526272829
303112345

View posts in large calendar

Month List

Disclaimer

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

Sign In