Print Page | Close Window

How to determine the group level of a focused row

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=10636
Printed Date: 12 November 2024 at 11:12pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to determine the group level of a focused row
Posted By: Peter59
Subject: How to determine the group level of a focused row
Date 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





Replies:
Posted By: Peter59
Date 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


Posted By: Aaron
Date 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....



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net