We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to manage Row Index in GridGroupingControl?

Platform: WinForms |
Control: QTP Add-On |
Published Date: April 30, 2011 |
Last Revised Date: July 10, 2014

 

GridGroupingControl control is not row index based grid. The ideal way to tackle this is to rely on the displayed elements.

This sample script replaces the GreatGrandChildName26 to MyName, refer to the screen shot of the replay below with explanation of each element till the modified record.

VB

 

SwfWindow("GridGroupingControl").Move 347,344

SwfWindow("GridGroupingControl").SwfObject("gridGroupingControl1").SetCurrentCell 5,"parentID"

SwfWindow("GridGroupingControl").SwfObject("gridGroupingControl1").ExpandRecord 5

SwfWindow("GridGroupingControl").SwfObject("gridGroupingControl1").SetCurrentCell 10,"childID"

SwfWindow("GridGroupingControl").SwfObject("gridGroupingControl1").ExpandRecord 10

SwfWindow("GridGroupingControl").SwfObject("gridGroupingControl1").SetCurrentCell 15,"grandChildID"

SwfWindow("GridGroupingControl").SwfObject("gridGroupingControl1").ExpandRecord 15

tablename = SwfWindow("GridGroupingControl").SwfObject("gridGroupingControl1").GetTableNameByLevel(3)

colIndex = 2

colname = SwfWindow("GridGroupingControl").SwfObject("gridGroupingControl1").GetColumnName(tablename, colIndex)

SwfWindow("GridGroupingControl").SwfObject("gridGroupingControl1").SetCellData 19, colname, "MyName"

Screenshot of the replayed sample with notes of each element. This sample can be referred in Essential TestStudio\Examples\Samples\bin\2.0\Grid\GGC_Hierarchical.exe

The helper function GetRowElement can also be used to know the kind of the element behind the row.

VB

 

For row = 1 To SwfWindow("GridGroupingControl").SwfObject("gridGroupingControl1").GetRowCount() -1 Step 1

    MsgBox SwfWindow("GridGroupingControl").SwfObject("gridGroupingControl1").GetRowElement(row)

Next

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon