cancel
Showing results for 
Search instead for 
Did you mean: 

delete from grid

Highlighted
Frequent Contributor

delete from grid

how to delet a particular record/row from a grid.When I record it selects particular record to delete script selects coordinates instead i want to write the code  :

i tried the below;

how can i select the particular row from a set of records, i tried to declare a variable, but doesnot seem to work.

i tried to delete the below way:it selects the whole grid not columns:

txtAttributeType="USD1"which was textedit field in a row.

 

if ((Aliases.Framework.ChildForm2.MainPanel.xtraTabControl1.WinFormsObject("xtraTabPageAttributes").WinFormsObject("attributesFinder1").WinFormsObject("dockPanelFilter").WinFormsObject("dockPanel1_Container").WinFormsObject("attributeFinderLayout1").WinFormsObject("layoutControl1").WinFormsObject("txtAttributeType") =="USD1"))
then
Aliases.Framework.ChildForm2.MainPanel.xtraTabControl1.xtraTabPageMaintenance.attributeMaintenanceControl1.grid.WinFormsObject("TextBoxMaskBox", "USD1").SetFocus();
Aliases.Framework.ChildForm2.MainPanel.xtraTabControl1.xtraTabPageMaintenance.attributeMaintenanceControl1.BarDockControl.DockedBarControl.ClickItem("Delete");

2 REPLIES
Community Hero

Re: delete from grid

Here's a lot of information on how to work with grids.  I suggest making sure you can find what you want in the grid before you start deleting things.

 

https://support.smartbear.com/testcomplete/docs/app-objects/specific-tasks/grids/common-operations.h...

Frequent Contributor

Re: delete from grid

Findrowby cell tex or FindRowInDataset  reference error  is seen any ideas?

 

function main()

{ var p, Grid,RowIndex;

Grid=Aliases.ChildForm2.MainPanel.xtraTabControl1.xtraTabPageMaintenance.attributeMaintenanceControl1.grid

RowIndex = FindRowInDataset (Grid, null, "Attribute Type", "452");

if (RowIndex != -1)

Grid.ClickCell(RowIndex, "Attribute Type");

else

Log.Error("Row was not Found");

}

Watch a Video Interview
Top Kudoed Authors
Are You In?

Meet the Community Leaders!

SmartBear Connect is an excellent opportunity for training, in-person support, and networking.

GET YOUR TICKET WITH $100 OFF