Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Controls
  New Posts New Posts RSS Feed - [SOLVED] How to get data from MarkupList
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[SOLVED] How to get data from MarkupList

 Post Reply Post Reply
Author
Message
Xander75 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2007
Status: Offline
Points: 353
Post Options Post Options   Thanks (0) Thanks(0)   Quote Xander75 Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED] How to get data from MarkupList
    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)
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: 19 November 2010 at 8:17am
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
gibra View Drop Down
Senior Member
Senior Member


Joined: 31 October 2008
Location: Italy
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote gibra Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Xander75 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2007
Status: Offline
Points: 353
Post Options Post Options   Thanks (0) Thanks(0)   Quote Xander75 Quote  Post ReplyReply Direct Link To This Post 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)
Back to Top
gibra View Drop Down
Senior Member
Senior Member


Joined: 31 October 2008
Location: Italy
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote gibra Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Xander75 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2007
Status: Offline
Points: 353
Post Options Post Options   Thanks (0) Thanks(0)   Quote Xander75 Quote  Post ReplyReply Direct Link To This Post 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)
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.234 seconds.