1

I have a DataGrid bounded to OservableCollection populated cols and rows dynamically. The DataGrid's row has couple of buttons. On each button a method is called (have implemented AddHandler while generating columns).

In the handler method, I can get which row was selected. I want to know the button of which column was selected. Based on that only I can take action and open respective windows.

How do I know which button of the row was selected ?

1
  • different handlers? or you can check the sender ( or sender's datacontext) Commented May 24, 2012 at 16:37

1 Answer 1

1

I get the column using :

int col = myDataGrid.CurrentCell.Column.DisplayIndex;
int row = seivesTorGrid.SelectedIndex; 

Based on this I am able to code respective actions.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.