Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to detect if the user is editing a property in a property grid?

I have a Windows form (.NET 3.5) that contains a propertygrid control. The propertygrid control gets refreshed periodically do display any changes that may have occurred in the class which it represents. I want the refresh to only occur if the user is not currently editing a property in the grid. Is there a way to detect if the user is currently editing a control?

like image 334
PICyourBrain Avatar asked Oct 21 '25 21:10

PICyourBrain


1 Answers

Yes - it's a little hacky but you can find out which subcontrol of the property grid is active, and make an educated guess based on what it is. The following seems to work:

bool isEditing = (propertyGrid.ActiveControl.GetType().Name != "PropertyGridView");
like image 142
Gwyn Avatar answered Oct 23 '25 12:10

Gwyn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!