c# Infragistics ultragrid setfocus on cell

6 comments

Problem: We have a form with a ultragrid displaying values.

On the form is a button to add a new row to the grid.

When clicking it we want the new row to be activated and the first cell to be selected.

In this solution the button adds a row with empty values to the datasource.

So in this solution we:

1) sort grid on column "Key" ("Key" is the name of one of our columns)

myGrid.DisplayLayout.Bands[0].Columns["Key"].SortIndicator = SortIndicator.Ascending;

2)activate the new row, with the desired cell            

myGrid.Rows[0].Cells["Key"].Activate();

3) open the cell for edit

myGrid.PerformAction(UltraGridAction.EnterEditMode, false, false);

Posted via email from Henris blogg

6 comments :