开发者

Cannot seem to fire DeleteCommand when button is an datagrid. Selected event always fires

开发者 https://www.devze.com 2023-01-24 17:09 出处:网络
I have a Wpf Form with a tabControl with 2 tabs \"Customers\" and CustomerDetail\" First Tab is a list of all Customers populated in a datagrid and delete Button as a dataTemplate on each line of the

I have a Wpf Form with a tabControl with 2 tabs "Customers" and CustomerDetail"

First Tab is a list of all Customers populated in a datagrid and delete Button as a dataTemplate on each line of the grid.

Selecting a customer it gets the customer details and moves to the second tab.

This all in MVVM and the delete button is mapped to a DeleteCommand .All good.

My Problem It cannot seem to distinguish when clicking on the delete button it fires the selected event and goes to the other tab.I dont want it to go to the other tab when pressing delete.

How can I do it?

User selects row and should go to the other tab.

Row is selected and presses delete button just trigger the delete command.

Ho开发者_开发问答pe all clear

Any suggestions?


Try using DoubleClick event for showing CustomerDetails tab. so, when user click on delete button, they just fire click command of the datagrid and nothing happen...

0

精彩评论

暂无评论...
验证码 换一张
取 消