Link to home
Start Free TrialLog in
Avatar of Balbirlally
Balbirlally

asked on

Add grid object

Hi Experts
I am using the following code to add an object to grid column. Which works fine , but if loose the focus to this form and when regain the focus I have an error saying grid text1 is not available. So I would like to check if Command1 object exist for Grid1 one every time I refresh the Grid. Is there any command ofr it ?

      With Thisform.GRID1.Columns(6)
            .RemoveObject("Text1")
            .AddObject("Command1","CHECKBOX")
            .Command1.Caption = 'Delete this Item'
            .Sparse = .F. && show the same button on all rows simultaneously
            .HEADER1.Caption = "Delete Icode"
            .HEADER1.Alignment = 2
            .Visible = .T.
            .READONLY = .F.
      Endwith

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
BTW, this Grid adjustment should be done in Init method only to ensure it is called just once. Another possibility is to call it when you change the RecordSource property.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial