Forum Discussion

Darshana's avatar
Darshana
Occasional Contributor
9 years ago

How can I use clickcolumnheader for my TDBGrid?

I can see the oprion of clickcolumnheader with my object

 

Dim dlgABILLity
Set aBILLity = Aliases.aBILLity
Set frmChargegroups = aBILLity.MasterForm.MdiClient.frmChargegroups
Set TDBGrid = frmChargegroups.TDBGrid
'TDBGrid.ClickColumnHeader("Destination")
call TDBgrid.ClickColumnHeader("Destination")

 

but if I run the same it show the error "An error occured"

 

 

Dim dlgABILLity
Set aBILLity = Aliases.aBILLity
Set frmChargegroups = aBILLity.MasterForm.MdiClient.frmChargegroups
Set TDBGrid = frmChargegroups.TDBGrid
'TDBGrid.ClickColumnHeader("Destination")
call TDBgrid.ClickColumnHeader("Destination")

 

I am using Testcomplete 11.

 

Thanks

Darshana

2 Replies

  • These are Delphi DB Grids right?

     

    Do you have debug info in the compiled exe?

     

    With debug info (which you pretty much need with these as there are a LOT of native methods and properties you won't get without it) I'm using a method called "DoTiTleButtonClick(<field-name>)" which works perfectly for me with all the various types of Delphi DB Grid (TDBGrid & TwwDBGrid .... off the top of my head).

     

    But for that to work, you need the <field-name> of the column in question. Which is not necessarily the same as the column header. You need to check the underlying dataset object for that.