Print Page | Close Window

[SOLVED] How to get data from MarkupList

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=17577
Printed Date: 03 May 2024 at 9:07pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [SOLVED] How to get data from MarkupList
Posted By: Xander75
Subject: [SOLVED] How to get data from MarkupList
Date Posted: 19 November 2010 at 7:06am
Hi,

Does anyone no how to get data from the MarkupList of a ComboBox?

Specifically I am looking to retrieve the data in text column 2 of which a user has selected, see below example code.


    With ComboBox1
        .Clear
        .EnableMarkup = True

        For i = 0 To 25
            .AddItem Chr$(65 + i)
            .MarkupList(.NewIndex) = "<Grid>" & _
                                     "    <Grid.ColumnDefinitions>" & _
                                     "        <ColumnDefinition Width='50'/>" & _
                                     "        <ColumnDefinition Width='200'/>" & _
                                     "    </Grid.ColumnDefinitions>" & _
                                     "    <Grid.RowDefinitions>" & _
                                     "        <RowDefinition/>" & _
                                     "    </Grid.RowDefinitions>" & _
                                     "    <TextBlock>" & .List(i) & "</TextBlock>" & _
                                     "    <TextBlock Grid.Column='2'>Col 2: " & i & "</TextBlock>" & _
                                     "</Grid>"
        Next
    End With




-------------
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition
Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6)



Replies:
Posted By: Aaron
Date Posted: 19 November 2010 at 8:17am
Hi,
 
Maybe this will help...
 
https://forum.codejock.com/forum_posts.asp?TID=14928&PID=51713#51713 - https://forum.codejock.com/forum_posts.asp?TID=14928&PID=51713#51713
 
 


-------------
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: gibra
Date Posted: 19 November 2010 at 8:21am
In this case, you can retrieve the col2 value with easy if you set the ItemData value for each item.
I.e.

    With ComboBox1
        .Clear
        .EnableMarkup = True

        For i = 0 To 25
            .AddItem Chr$(65 + i)
            .ItemData(.NewIndex) = i
            .MarkupList(.NewIndex) = "<Grid>" & _
                [...]
        Next
    End With

Later, you can get the value using

    value = ComboBox1.ItemData(ComboBox1.ListIndex)
 
 


-------------
gibra
CJ SuiteControl v: 13.x to 19.x
Windows 10 64bit
VS2019 - VB6.0 SP6
<a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8


Posted By: Xander75
Date Posted: 19 November 2010 at 8:24am
@Aaron thanks I will check this out.
 
@gibra that's fine for only a two column list (as per example), however if I had a combobox that has 3 or more columns I would need a way to get each of the unique columns data.


-------------
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition
Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6)


Posted By: gibra
Date Posted: 19 November 2010 at 8:30am
Originally posted by Xander75 Xander75 wrote:

@gibra that's fine for only a two column list (as per example), however if I had a combobox that has 3 or more columns I would need a way to get each of the unique columns data.
 
I'have replyed about the case you have posted.
 
THIS other cases are totally different from you your original request.
THIS cases require to parse the item, of course.
 
The link posted by Aaron maybe solve your question.


-------------
gibra
CJ SuiteControl v: 13.x to 19.x
Windows 10 64bit
VS2019 - VB6.0 SP6
<a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8


Posted By: Xander75
Date Posted: 02 December 2010 at 3:54am
Solved using Aaron's suggestion.

-------------
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition
Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6)



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