Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
355
why would UltraGrid.PerformAction fail
posted

...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;
}

Parents
  • 53790
    posted

    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

Reply Children