Determine CellText, selected text in WPF Datagrid

Jun 30, 2010 at 6:08 AM

Hi Experts,

I wanted to get the SelectedText on edit mode in WPF datagrid (i.e Active cell can be entire text or partial text selected by user within datagrid)

SelectedLength(Length of the selected text in datagrid cell), Selected Position (cursor position in datagrid cell). How these all values can be achieved in WPF datagrid. For better understanding please read the below example.

For Example: suppose user has double clicked datagrid in row 1 and col 2 position, data available on the selected position is Text. Consider user has selected only ext out of (Text). So my expected result should be

Selected Text: ext
Selected Position: 1
Selected Length: 3
Cell Text: Text

Thanks in advance