tags:

views:

105

answers:

1

I have wpf datagrid with number of template columns. some of them have textbox in them in edit mode and some combobox.

i need to give cut/copy/paste facility to user from main menu (ribbon) buttons of my application.

when i select some text from textbox and press copy button from main menu. copy button becomes active control so i loose textbox as active control by which i could get selected text.

(any solution for this)

and second thing i wanted to ask... is there any event get fired when we select textbox's contents?

or solution would be appreciated. Thanks in advance...

A: 

Answers:

  1. You need to set FocusManager.IsFocusScope on your main menu ribbon so that it will track focus separately from your main application.

  2. Yes there is a TextBox.SelectionChanged event that will be fired whenever your selection changes in a TextBox.

Ray Burns