How to apply a row click in an EpiUltraGrid

I am trying to apply a row click in an EpiUltraGrid. I am able to select and activate the row, but I want to click the row using code.
Below is my code.

EpiUltraGrid grdList;
grdList = (EpiUltraGrid)csm.GetNativeControlReference(“fe13aebf-c0cd-4ae4-ad55-ece046bcf3ce”);

        int int1 = grdList.Rows.Count;

        if (grdList.Rows.Count > 0)
        {

            foreach(UltraGridRow rowx in grdList.Rows)
            {
               MessageBox.Show("in Foreach: InvoiceNum: " + rowx.Cells["InvoiceNum"].Value.ToString() );

                if (  Convert.ToInt32(rowx.Cells["InvoiceNum"].Value) == 2223583 )
                {
                    MessageBox.Show("before: rowx.Selected and Activated= true;");
                    rowx.Selected = true; 
                    rowx.Activated = true;
                    rowx.Activate();
                    MessageBox.Show("after: rowx.Selected and Activated= true;");
                }
            }
        }

Got it. Had to add the “grdList.Select();”.

rowx.Selected = true;
rowx.Activated = true;
rowx.Activate();
grdList.Select();

1 Like