Print Page | Close Window

combox pulldown list index

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=11845
Printed Date: 28 September 2024 at 4:32am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: combox pulldown list index
Posted By: axdoverm
Subject: combox pulldown list index
Date Posted: 16 August 2008 at 4:57am
Hey too all your guys out there. I just start using te reportcontrol, witch is by the way a supertool ...... but i have a simple question. In my reportcontrol i have a combobox wich contains values. I understand how the get the caption (value) from the selection that the user made. But i need to know the index of the selected value so i can match this with a value in a other control.
 
I hope someone can help me with this, because i spent the last 2 days searching for a solution ..... and i start too pullout my hair



Replies:
Posted By: axdoverm
Date Posted: 18 August 2008 at 3:21am
Hi Aaron,
 
I just got your message and i wil give it later today a try .... i will keep je informed.
 
Thanks in advandce


Posted By: Aaron
Date Posted: 18 August 2008 at 4:09am
Hi,
 
I don't know if there's another way but you could loop constraints of item like this in ValueChanged event:
 
    Dim itemConstraint As ReportRecordItemConstraint
    If Item.EditOptions.Constraints.Count > 0 Then
        For Each itemConstraint In Item.EditOptions.Constraints
            If itemConstraint.Caption = Item.Caption Then
                MsgBox itemConstraint.Index
            End If
        Next itemConstraint
    End If
 
 
If your issue has been solved, please add SOLVED in your Topic description and have a look at post http://forum.codejock.com/forum_posts.asp?TID=11225 - http://forum.codejock.com/forum_posts.asp?TID=11225



-------------
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....


Posted By: axdoverm
Date Posted: 18 August 2008 at 6:17am
Hi,
 
I tried your first solution:
 
Private Sub ReportControl1_ConstraintSelecting(ByVal Row As XtremeReportControl.IReportRow, ByVal Column As XtremeReportControl.IReportColumn, ByVal Item As XtremeReportControl.IReportRecordItem, ByVal Constraint As XtremeReportControl.IReportRecordItemConstraint)
 MsgBox Constraint.Index
End Sub
 
and i get back the right index. The ReportControl1_ConstraintSelecting event only fires when i change the selection with my keyboard, but not when i use the mouse to select the item in the list??
 
So i tried the second solution but i receive a error : object variable or with block variable not set : Runtime Error 91
 
I think i'm missing something   ......
 


Posted By: Aaron
Date Posted: 18 August 2008 at 9:13am
Hi,
 
Seems that it's the only way to get index of constraint. I guess we need an event:
 
Private Sub wndReportControl_ConstraintSelected(ByVal Row As XtremeReportControl.IReportRow, ByVal Column As XtremeReportControl.IReportColumn, ByVal Item As XtremeReportControl.IReportRecordItem, ByVal Constraint As XtremeReportControl.IReportRecordItemConstraint)
    msgbox Constraint.Index
End Sub
 
or in ValueChanged event reference of selected constraint  I will add it to my list and maybe a support member can take a look at this.
But if you need this you could use the code (above).
 


-------------
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....


Posted By: axdoverm
Date Posted: 18 August 2008 at 1:42pm

Hi,

Thanks again for your reply, tonight i will give it another try .... i will keep you informed. I hope someone at the support can take a look at it .... and i hope someone can show my the right way..

Greeting Andre


-------------
Product: Xtreme SuitePro (ActiveX) version 11.2.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0



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