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
515
Cell SelectAll
posted

On form load i want a select all text in a particular cell value.

Here is my code, and cell is editable by user

 

ugPayments.ActiveCell = ugPayments.Rows(i).Cells(4)

ugPayments.ActiveCell.Selected =

True

ugPayments.ActiveCell.SelectAll()

But it is throwing me an error saying

Operation cannot be performed when not in edit mode.

Parents
No Data
Reply
  • 37774
    Suggested Answer
    posted

    I think that you're confusing the Seleted state of a cell with actually selecting the text in the editor.  If you want to always select the text when the user enters edit mode you could do something like:

    private void ultraGrid1_AfterEnterEditMode(object sender, EventArgs e)
    {
        this.ultraGrid1.ActiveCell.EditorResolved.SelectAll();
    }

    If you want to programmatically enter edit mode:

    this.ultraGrid1.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode);

    -Matt

Children