giovedì 22 gennaio 2009

Focus on FilterRow - Infragistics Forums

Focus on FilterRow - Infragistics Forums: "You could do something like this:
this.ultraGrid1.Focus();
this.ultraGrid1.ActiveCell = this.ultraGrid1.Rows.FilterRow.Cells[0];
this.ultraGrid1.PerformAction(UltraGridAction.EnterEditMode);
Note that this will not work if you try to do it in the Forn_Load event of your form, because this event does not allow you to set focus to a control. So if you want your form to come up with the filter cell active initially, I recommend using a BeginInvoke. Like so:

private void Form1_Load(object sender, System.EventArgs e)
{
// Set grid's DataSource

this.BeginInvoke(new MethodInvoker(this.SetFocusToFirstFilterCell));
}

private void SetFocusToFirstFilterCell()
{
this.ultraGrid1.Focus();
this.ultraGrid1.ActiveCell = this.ultraGrid1.Rows.FilterRow.Cells[0];
this.ultraGrid1.PerformAction(UltraGridAction.EnterEditMode);
}"

Nessun commento:

Posta un commento