Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Controls
  New Posts New Posts RSS Feed - ListView Markup Help
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ListView Markup Help

 Post Reply Post Reply
Author
Message
Exo31 View Drop Down
Newbie
Newbie
Avatar

Joined: 25 August 2009
Location: United Kingdom
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Exo31 Quote  Post ReplyReply Direct Link To This Post Topic: ListView Markup Help
    Posted: 18 August 2010 at 10:04am
Hi,

I am working on using the markup function on some data held in a list view.
I have the following code:

    lstTx.AddItem "<Border BorderThickness='2' BorderBrush='Green' Margin='0, 2, 0, 2' Padding='3'><StackPanel Orientation='Horizontal'>" & _
    "<Image Source='201'/>" & _
    "<Grid><Grid.ColumnDefinitions><ColumnDefinition Width='Auto'/><ColumnDefinition Width='*'/></Grid.ColumnDefinitions>" & _
    "<Grid.RowDefinitions><RowDefinition/><RowDefinition/></Grid.RowDefinitions>" & _
    "<TextBlock TextAlignment='Right' FontWeight='Bold' Foreground='Navy' Text='Device:'/>" & _
    "<TextBlock TextAlignment='Right' Grid.Row='1' FontWeight='Bold' Foreground='Navy' Text=' IP Address:'/>" & _
    "<TextBlock Margin='6, 0, 0, 0' Grid.Column='1' Text='UnitName'/>" & _
    "<TextBlock Margin='6, 0, 0, 0'  Grid.Column='1' Grid.Row='1'  Text='IPAddress'/>" & _
    "</Grid></StackPanel></Border>"

The items in red are showing up in my list view just as text however I need to display text that comes from a string. I am extracting a value from a database and storing that in a string.

How can I display the text from a string using markup in list view?

Please help.

Thx
Product: Xtreme SuitePro (ActiveX) version 13.1.0
Platform: Windows XP SP 2
Language: Visual Basic 6 SP6
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 20 August 2010 at 12:49pm
Something like this assuming UnitName is the vaiable...
"<TextBlock Margin='6, 0, 0, 0' Grid.Column='1' Text='" & UnitName &"'/>" & _
Back to Top
Exo31 View Drop Down
Newbie
Newbie
Avatar

Joined: 25 August 2009
Location: United Kingdom
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Exo31 Quote  Post ReplyReply Direct Link To This Post Posted: 20 August 2010 at 12:56pm
Thanks that is exactly what I was looking for! Much appreciated.
Product: Xtreme SuitePro (ActiveX) version 13.1.0
Platform: Windows XP SP 2
Language: Visual Basic 6 SP6
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 20 August 2010 at 2:17pm
Also, you will want to encode characters that will break your markup rendering when trying to display text values from variable:

http://forum.codejock.com/forum_posts.asp?TID=10865
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
Exo31 View Drop Down
Newbie
Newbie
Avatar

Joined: 25 August 2009
Location: United Kingdom
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Exo31 Quote  Post ReplyReply Direct Link To This Post Posted: 23 August 2010 at 4:16am
Thanks jpbro I will implement the encode as you suggested.
Product: Xtreme SuitePro (ActiveX) version 13.1.0
Platform: Windows XP SP 2
Language: Visual Basic 6 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.203 seconds.