Forum Discussion

msap's avatar
msap
Frequent Contributor
6 years ago

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

    • msap's avatar
      msap
      Frequent Contributor

      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");

      }