ultraGrid1.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.FirstCellInGrid).
ultraGrid1.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.entereditmode).
Thanks for your replay. Maybe I'm trying the wrong solution here. I just want to make sure that the key value is provided first when adding a new row, so that I can check if the entered key value maybe already of an existing row (which means you are updating an existing row instead of creating a new one).
I'm looking for a best practice for maintaining data in an ultragrid. Would there be a simple example somewhere for just creating, updating and deleteing data with an ultragrid (preferably with a TemplateAddRow)?
If you click on the TemplateAddRow, then the focus is going to go into the cell that was clicked? You want to force the user into the first cell, even when they explicitly click on a different cell?
My guess is that you are unable to do this because of timing. You are probably setting the ActiveCell before the mouse message has been completely processed, which means your code is working, but then the focus gets taken away again. So you might have to find a better event to do what you want, or perhaps use a BeginInvoke to create a delay before your code is executed.
I have a similar problem. I would like to set focus to the first cell of the TemplateAddRow when a new row is added (i.e. when the template row is clicked). Using e.Row.Cells[0].Activate() or ultraGrid1.ActiveCell = ultraGrid1.Rows.TemplateAddRow.Cells[0] does not seem to work. Any suggestions are welcome
Thanks Matt, now my grid works fine.
You could try using the AfterRowInsert event to call e.Row.Cells[0].Activate(), assuming that the grid has focus at that point. If you want to make sure that the cell is in edit mode, call grid.PerformAction(UltraGridAction.EnterEditMode) after activating the cell.
-Matt