Hi
How to set index with the following code by click on header:
sele phystock
inde on icode tag icode
inde on barcode tag barcode addi
inde on cartons tag cartons addi
inde on units tag units addi
inde on amount tag amount addi
Sele phystock
Go Top
DoDefault()
With Thisform.contMaster.Grid1
.Visible = .T. && Grid control visible
.Themes = .F.
.Width = 925
.Height = 426
.Top = 167
.Left = 0 && Adjust Grid position
.ColumnCount = 6
.HeaderHeight = 29
.RowHeight = 27
.ReadOnly = .T.
.FontName = "Tahoma"
.RecordSource = "Phystock"
.RecordSourceType = 1
.SetAll("dynamicbackcolor", "IIF(RECNO()%2 = 0,RGB(149,221,255), RGB(255,255,255))", "Column")
.DeleteMark = .F.
.ScrollBars = 3
.Column1.Header1.Caption = 'I-Code'
.Column2.Header1.Caption = 'BarCode'
.Column3.Header1.Caption = 'Full Description'
.Column4.Header1.Caption = 'Cartons'
.Column5.Header1.Caption = 'Units'
.Column6.Header1.Caption = 'Value'
.Column1.Header1.Alignment = 2 &&middle right
.Column2.Header1.Alignment = 2 &&middle right
.Column3.Header1.Alignment = 2 &&middle right
.Column4.Header1.Alignment = 2 &&middle right
.Column5.Header1.Alignment = 2 &&middle right
.Column6.Header1.Alignment = 2 &&middle right
.Column1.Alignment = 0
.Column2.Alignment = 0
.Column3.Alignment = 0
.Column4.Alignment = 1
.Column5.Alignment = 1
.Column1.Width = 88
.Column2.Width = 131
.Column3.Width = 340
.Column4.Width = 110
.Column5.Width = 110
.Column6.Width = 110
.Column1.ControlSource = "Phystock.icode"
.Column2.ControlSource = "Phystock.BarCode"
.Column3.ControlSource = "Phystock.Full_desc"
.Column4.ControlSource = "Phystock.Cartons"
.Column5.ControlSource = "Phystock.Units"
.Column6.ControlSource = "Phystock.amount"
.Column1.FontSize = 10
.Column2.FontSize = 10
.Column3.FontSize = 9
.Column4.FontSize = 10
.Column5.FontSize = 10
.Column6.FontSize = 10
.Column4.InputMask = '9,999,999.999'
.Column5.InputMask = '9,999,999.999'
.Column6.InputMask = '99,999,999.99'
Endwith
On single click it should index in ascending order while in dblclick it should be descending.
Thanks
Saif
How to set index with the following code by click on header:
sele phystock
inde on icode tag icode
inde on barcode tag barcode addi
inde on cartons tag cartons addi
inde on units tag units addi
inde on amount tag amount addi
Sele phystock
Go Top
DoDefault()
With Thisform.contMaster.Grid1
.Visible = .T. && Grid control visible
.Themes = .F.
.Width = 925
.Height = 426
.Top = 167
.Left = 0 && Adjust Grid position
.ColumnCount = 6
.HeaderHeight = 29
.RowHeight = 27
.ReadOnly = .T.
.FontName = "Tahoma"
.RecordSource = "Phystock"
.RecordSourceType = 1
.SetAll("dynamicbackcolor", "IIF(RECNO()%2 = 0,RGB(149,221,255), RGB(255,255,255))", "Column")
.DeleteMark = .F.
.ScrollBars = 3
.Column1.Header1.Caption = 'I-Code'
.Column2.Header1.Caption = 'BarCode'
.Column3.Header1.Caption = 'Full Description'
.Column4.Header1.Caption = 'Cartons'
.Column5.Header1.Caption = 'Units'
.Column6.Header1.Caption = 'Value'
.Column1.Header1.Alignment = 2 &&middle right
.Column2.Header1.Alignment = 2 &&middle right
.Column3.Header1.Alignment = 2 &&middle right
.Column4.Header1.Alignment = 2 &&middle right
.Column5.Header1.Alignment = 2 &&middle right
.Column6.Header1.Alignment = 2 &&middle right
.Column1.Alignment = 0
.Column2.Alignment = 0
.Column3.Alignment = 0
.Column4.Alignment = 1
.Column5.Alignment = 1
.Column1.Width = 88
.Column2.Width = 131
.Column3.Width = 340
.Column4.Width = 110
.Column5.Width = 110
.Column6.Width = 110
.Column1.ControlSource = "Phystock.icode"
.Column2.ControlSource = "Phystock.BarCode"
.Column3.ControlSource = "Phystock.Full_desc"
.Column4.ControlSource = "Phystock.Cartons"
.Column5.ControlSource = "Phystock.Units"
.Column6.ControlSource = "Phystock.amount"
.Column1.FontSize = 10
.Column2.FontSize = 10
.Column3.FontSize = 9
.Column4.FontSize = 10
.Column5.FontSize = 10
.Column6.FontSize = 10
.Column4.InputMask = '9,999,999.999'
.Column5.InputMask = '9,999,999.999'
.Column6.InputMask = '99,999,999.99'
Endwith
On single click it should index in ascending order while in dblclick it should be descending.
Thanks
Saif