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
1015
Clearing data from a row
posted

What is the best way to clear the data from a row, and make the first cell in that row the active cell?

I have a grid with 3 columns. If the user enters a zero in column 2 or 3, I would like all the data entered in that row to be cleared, and the ActiveCell to be returned to the first column of that row.

I've tried to do this in a number of ways, but none work just right. I'm sure there is a simple way to do this.

Also, in which event should this clearing and positioning be done? I think part of my problem is that I am trying to do this in the AfterExitEditMode event, after I sense that a zero has been entered. After I clear the data, I do the following:

With ugItemsPicked

    .ActiveCell = .Rows(.ActiveRow.Index).Cells(0)

    .PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode)

End With

But when I do it there, the focus doesn't really go to the first cell. Why isn't the first cell activated? Does it have to do with the AfterExitEditMode event confusing it? Which event is the best place for this?

Thanks for your assistance.