Mar 31, 2014, 4:40 AM
Can not convert DataView XTemplate to CodeBehind
Hi I have this code which works perfectly
I need to put it into codebehind it doesn't work propery... the data displays but the css does not work...
<ext:DataView ID="DataView1" EmptyText="No Records" runat="server"
SingleSelect="true"
Cls="img-chooser-view"
OverItemCls="x-view-over"
ItemSelector="div.thumb-wrap" StoreID="Store1">
<Tpl ID="Tpl1" runat="server">
<Html>
<tpl for=".">
<div class="thumb-wrap">
<div class="thumb">
<tpl>
<span class="ListDescription">{name}</span>
<span class="Image"><img height="60" onerror="ImageError(this);" src="{id}" /></span>
</tpl>
</div>
</div>
</tpl>
</Html>
</Tpl>
</ext:DataView>
I need to put it into codebehind it doesn't work propery... the data displays but the css does not work...
Dim DataView1 As New DataView
DataView1.ID = "DataView1"
DataView1.Border = False
DataView1.StoreID = "Store1"
DataView1.OverItemCls = "x-view-over"
DataView1.TrackOver = True
DataView1.ItemSelector = "div.thumb-wrap"
Dim html As String = ""
html += "<tpl for="".""> "
html += "<div class=""thumb-wrap"">"
html += "<div class=""thumb"">"
html += "<tpl>"
html += "<span class=""ListDescription"">{name}</span>"
html += "<span class=""Image""><img height=""60"" onerror=""ImageError(this);"" src=""{id}"" /></span>"
html += "</tpl>"
html += "</div>"
html += "</div>"
html += "</tpl>"
Dim itemTpl As New XTemplate()
itemTpl.Html = html
DataView1.ItemTpl = itemTpl
Last edited by blurken; Mar 31, 2014 at 6:13 AM.