It appears in order to get what text a user has selected in a cell, the Grid has to be in edit mode. If you try and get the SelText property you get this error; "Selection related properties (SelText, SelStart and SelLength) are not supported while the cell is not in edit mode." If UltraGrid.PerformAction(EnterEditMode) is executed, all the text is selected anyway so... Hmmm... Am I missing something?
Hello,
I believe that this behavior is correct since the above mentioned properties are only available when the cell is in edit mode and there is an editor in it. If you want to access them you would need to put the desired cell in editmode.
Please do not hesitate to ask if something comes up.
Let me clarify the issue. The user selects text in a cell by highlighting a few characters. In code, I need check to see if there are any characters selected by the user. But in order to do that, I have to put the Grid in EditMode. By doing this, the entire text gets selected. Here is an example; If the cell's value is 'Red Car' and the user selects only 'Car', in code to get the selected text, the grid gets put in edit mode, however, now SelText = 'Red Car' which is not correct.
Then you need to store the 'SelectionLength' and 'SelectionStart' properties of the cell editor on 'BeforeExitEditMode'. Please clarify if this helps.
Please do not hesitate to contact us if you need any additional assistance.
Looks like this is the behavior when the grid loses focus to another control.