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.
That is an older version of NetAdvantage, so if you're experiencing the same error as outlined in that KB article, it should be fixed already since it was done a while ago. I'm still not certain that it's the same error, however. You should probably submit a sample to Developer Support so that they can look further into it.
If you do want to try the latest version before submitting the issue, you could get the latest service release here.
-Matt
I have Infragistics2.Win.v8.3.20083.1009. I googled and got this link for a hot fix. I don't know if it applies to my version.
http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=9678
The only time I really see the EnterEditMode action fail is when the grid fails to gain focus, which is why I tried using a BeginInvoke to get around that. Ensure that invoking this method is the very last thing that you do in the form's Load event; you may even try explicitly setting focus to the grid after calling PerformAction, though this is done implicitly. If this still doesn't work, it's likely a timing issue. For example, does this code work if you add a button to the form and execute the code in the Click event? If it does, then it definitely is a timing issue with the form not allowing the grid to take focus quite yet. Perhaps if this is the case, you could start another thread, have a timer wait a second on that thread, then invoke the code to enter edit mode back to the main thread.
As for version numbers, the main version should be part of your reference (i.e. Infragistics2.Win.v8.2.dll). The actual build number is the last 4 digits in the Version field in the PropertyGrid when looking at the properties of that particular DLL.
sorry for the ugly posting. btw where do i get my infragistics version number
The code I have is
Me.BeginInvoke(New MethodInvoker(AddressOf EnterAndSelectText))
Private Sub EnterAndSelectText()
Me.ugPayments.PerformAction(UltraGridAction.EnterEditMode)
Me.ugPayments.ActiveCell.SelectAll()
End Sub
I can modify the code to avoid error as follows, but it will not select the text in cell
Private
Sub EnterAndSelectText()
If Me.ugPayments.PerformAction(UltraGridAction.EnterEditMode) Then
End If