Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Value change / Revert automaticly
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Value change / Revert automaticly

 Post Reply Post Reply
Author
Message
simps View Drop Down
Groupie
Groupie


Joined: 08 August 2007
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote simps Quote  Post ReplyReply Direct Link To This Post Topic: Value change / Revert automaticly
    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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.