Forum Discussion

Nformation's avatar
Nformation
Contributor
10 years ago

How do I click a grid row? Or, click a button in a cell?

I need a function that can click on the + button shown below for a given row index. So far, I've been unable to click it using the ClickCell method. I would be fine with clicking the left end of the ...
  • Nformation's avatar
    Nformation
    10 years ago

    Thank you all for your suggestions. I had not been looking for the WPFObjects, which is where I eventually found what I needed. Here's what I came up with.

     

     

    function clickDetailsButtonAtIndex(index)
    {
      // use when specifying the row: WPFObject("RowControl", "", index)
      index++;
     Aliases.Informa_Cashiering_Client.CurrentTransaction.ApplicationWindow.Grid.FloatingContainerBorder.Grid.FloatingContainerBody.border.Grid.PART_ContainerContent.Grid.ContentControl.ViewTransactionsView.Grid.GridControl.TableView.HierarchyPanel.WPFObject("RowControl", "", index).WPFObject("CellsControl", "", 1).WPFObject("LightweightCellEditor", "", 1).WPFObject("ButtonEdit", "", 1).Click();
    
    }

    This calls the Click() function on the button in the row specified by the index (I increment the index because I want the function to be 0-based).  Thanks again!