Value change / Revert automaticly |
Post Reply |
Author | |
simps
Groupie Joined: 08 August 2007 Status: Offline Points: 11 |
Post Options
Thanks(0)
Posted: 27 December 2023 at 8:16am |
Problem : if item caption is changed once, it's not able to be changed again manually. to see my problem clearly; vb6 / new project add reportcontrol1 copy & paste the code below. Option Explicit Private Sub Form_Load() Dim newRec As ReportRecord With ReportControl1 .SetCustomDraw (xtpCustomBeforeDrawRow) .Columns.Add 0, "Add", 100, True .Columns.Add 1, "Part Name / Component", 200, True .Columns.Add 2, "Purchase Order Qty", 100, True .Columns.Add 3, "Production Order Qty", 100, True .Columns(1).TreeColumn = True Set newRec = .Records.Add newRec.AddItem "" newRec.Item(0).HasCheckbox = True newRec.AddItem "Car" newRec.AddItem 2 newRec.AddItem 2 newRec.Item(0).HasCheckbox = True .Populate Set newRec = .Rows(0).Record.Childs.Add newRec.AddItem "" newRec.Item(0).HasCheckbox = True newRec.AddItem "Part-A" newRec.AddItem 4 newRec.AddItem 4 newRec.Item(0).HasCheckbox = True Set newRec = .Rows(0).Record.Childs.Add newRec.AddItem "" newRec.Item(0).HasCheckbox = True newRec.AddItem "Part-B" newRec.AddItem 4 newRec.AddItem 4 newRec.Item(0).HasCheckbox = True Set newRec = .Rows(0).Record.Childs.Add newRec.AddItem "" newRec.Item(0).HasCheckbox = True newRec.AddItem "Part-C" newRec.AddItem 2 newRec.AddItem 2 newRec.Item(0).HasCheckbox = True newRec.ParentRecord.Expanded = True .Columns(1).Editable = False .Columns(2).Editable = False .Populate .AllowEdit = True End With End Sub Private Sub Form_Resize() ReportControl1.Move 120, 120, Me.ScaleWidth - 240, Me.ScaleHeight - 240 End Sub Private Sub ReportControl1_BeforeDrawRow(ByVal Row As XtremeReportControl.IReportRow, ByVal Item As XtremeReportControl.IReportRecordItem, ByVal Metrics As XtremeReportControl.IReportRecordItemMetrics) If Item.Index = 3 Then Metrics.BackColor = vbYellow End Sub Private Sub ReportControl1_ValueChanged(ByVal Row As XtremeReportControl.IReportRow, ByVal Column As XtremeReportControl.IReportColumn, ByVal Item As XtremeReportControl.IReportRecordItem) If Row.RowTreeLevel = 0 Then Dim rr As ReportRow Dim multi multi = Row.Record.Item(2).Caption / Row.Record.Item(3).Caption For Each rr In Row.Childs rr.Record.Item(3).Caption = CDbl(rr.Record.Item(2).Caption) / multi Next ReportControl1.Populate End If End Sub |
|
VB6
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |