Determine Name/Value column focus/selected

Grids for WPF Forum

Posted 10 years ago by Michael Nugent
Version: 14.1.0601


Is there a way to determine which column (name or value) has focus (or has been selected)?   We have a custom class that inherits from PropertyGridDataAccessorItem and use the Selected event but I cannot see a way to determine which column is the selected column for the selected row.  We also have a class that inherits from Label that provides a template for the name column and I can use a mouse down event to determine when the user clicks the name column (but then the PropertyGridDataAccessorItem Selected event is fired afterwards which would undo the action taken in the mouse down event).  I need to be able to determine which column has actual focus to enable/disable other parts of the application - enabled when the name column is focused, disabled when the cursor is in the value column.  The ideal scenerio would allow this to all occur (or be figured out) in the Selected event in our PropertyGridDataAccessorItem class.



Comments (2)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Michael,

I don't believe we track anything for knowing which column is focused.  However if I recall correctly, when the name column has focus, it should be a PropertyGridDataAccessorItem that has focus.  Otherwise, the focus would be in an editor control of some sort in the value editor template.  So perhaps you could look at the Keyboard.FocusedElement value to see which sort of element it is and base your logic off that.

Actipro Software Support

Posted 10 years ago by Michael Nugent

Excellent suggestion - I think for the most part this is going to be helpful.  Thanks!

The latest build of this product (v24.1.2) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.