ListView Markup Help |
Post Reply |
Author | |
Exo31
Newbie Joined: 25 August 2009 Location: United Kingdom Status: Offline Points: 5 |
Post Options
Thanks(0)
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 |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
Something like this assuming UnitName is the vaiable...
"<TextBlock Margin='6, 0, 0, 0' Grid.Column='1' Text='" & UnitName &"'/>" & _
|
|
Exo31
Newbie Joined: 25 August 2009 Location: United Kingdom Status: Offline Points: 5 |
Post Options
Thanks(0)
|
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 |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
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 |
|
Exo31
Newbie Joined: 25 August 2009 Location: United Kingdom Status: Offline Points: 5 |
Post Options
Thanks(0)
|
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 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |