I have multiple XamDataGrids in my screen and each of them has a button which is provided by this style -
<Style x:Key="BtnStyle" TargetType="{x:Type Button}">
<!-- set some color, width etc .. -->
<EventSetter Event="Click" Handler="btnClick"/>
</Style>
I cannot have a command for this button due to some constraints so I am handling the normal click event.
When the button is clicked, in my code behind I loop though the grids and get the cell whose button was clicked by doing this - if (dataGrid.ActiveCell != null) { // do something ... }.
The problem is after I clicked a button on 1st grid, if I click on a button in the 2nd grid the ActiveRecord is still treated as the cell originating from the 1st grid. So even if I am in the 2nd grid I get the ActiveRecord as the 1st grid record.
Is there any way to reset the active record or any other way to ensure the event is from the grid I have clicked currently?
Yes this got resolved. Thanks for your help..
HI,
Please let me know if you need further assistance regarding this issue.
Sincerely, Matt Developer Support Engineer
Please let me know if you need further assistance regarding this post.
Sincerely,
Matt Developer Support Engineer
Please let me know if you need further assistance regading this issue.
Sincerely, MattDeveloper Support Engineer
This works fine. Thanks the issue got resolved.