Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - How to determine the group level of a focused row
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to determine the group level of a focused row

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


Joined: 19 July 2007
Status: Offline
Points: 61
Post Options Post Options   Thanks (0) Thanks(0)   Quote Peter59 Quote  Post ReplyReply Direct Link To This Post Topic: How to determine the group level of a focused row
    Posted: 15 May 2008 at 10:37am
Hi,

is there a way to determine the group level and the index of the grouped column of a focused row for example in the SelectionChanged event?

Something like that:

Sub ReportControl_SelectionChanged()

If ReportControl.FocusedRow.GroupRow Then
    Msgbox "GroupLevel="; [Grouplevel]
    Msgbox "ColumnIndex="; [Index of grouped column]
End If


Any ideas?

Thanks,
Peter


Back to Top
Peter59 View Drop Down
Groupie
Groupie


Joined: 19 July 2007
Status: Offline
Points: 61
Post Options Post Options   Thanks (0) Thanks(0)   Quote Peter59 Quote  Post ReplyReply Direct Link To This Post Posted: 15 May 2008 at 2:56pm
An approach for determining the group level

Sometimes it is a good idea to write a problem down (or to post it) and to pause for a while...

My approach to determine the group level is current an iteration "upwards" through all ParentRows until ParentRow points to Nothing. Counting the steps will result in the group level.

Sub ReportControl_SelectionChanged()

    Dim rptRow as ReportRow
    Dim iLevel as Integer

    If ReportControl.FocusedRow.GroupRow Then

        iLevel = 1
        Set rptRow = .ParentRow
        Do Until rptRow Is Nothing
            Set rptRow = rptRow.ParentRow
            iLevel = iLevel + 1
         Loop

    Msgbox "GroupLevel="; iLevel
    Msgbox "ColumnIndex="; [Index of grouped column]
End If 



Is there maybe a way to get the level in a better (shorter) way?

But how to get the index of the grouped column? No ideas?

Peter
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 15 May 2008 at 11:08pm
Hi,
 
The found grouplevel could be used to determine the index of the column:
 
wndReportControl.GroupsOrder(iLevel - 1).Index
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.

This page was generated in 0.578 seconds.