...using Infragistics2.Win.UltraWinGrid.v9.2
The online documentation only says "true if the action completed successfully, false if the action failed."
I have users periodically reporting the error"Selection related properties(SelText, SelStart and SelLength) are not supported while the cell is not in edit mode". This code has run for years and it's my first time seeing this error. I went ahead and added if() blocks around the calls to PerformAction and swallowed the error just in case. So its handled, but what would cause the call to PerformAction fail?
/// <remarks> /// This method ensures the cursor remains at the end of the cell text if the user switches to another application /// while entering a note and then switches back. /// </remarks> private void NotesGrid_GotFocus(object sender, EventArgs e) {
.....
MoveCursorToEndOfCell(subjectCell)
}
private void MoveCursorToEndOfCell(UltraGridCell cell) { NotesGrid.PerformAction(UltraGridAction.ExitEditMode); NotesGrid.PerformAction(UltraGridAction.EnterEditMode); cell.SelStart = cell.Text.Length;}
Hello Kevin,
I was not able to reproduce your issue, but if you have a sample that reproduce it, I`ll be glad to take a look.
Looking at the information from your post, maybe one possible reason for this issue, could be if you have not Active/Selected cell. Maybe will be better to include If conditions and check for ActiveCell.
Please send us more details about your scenario / sample and I`ll try to help you. If you have any questions, feel free to write me
Regards
Hello Georgi,
I've never actually been able to produce the error myself, but I did receive the following screen shot from a user and, assuming their memory was correct, they were at a point where the code would activate a tab that contains a single control, the UltraGrid. That Grid has that OnFocus event that eventually makes a call to PerformAction method... it is intended to place the user's cursor into a cell and force it into edit mode so they can just start typing.
image here https://skydrive.live.com/redir?resid=57BD806B25C63EDE!118&authkey=!ADWFBSaZgtN3Zxc