Jul 20, 2010, 9:48 PM
DataView [0.8.1] The Template can't be empty
Hi,
I have the following code. Mainly I am trying to display something like this: https://examples1.ext.net/#/TreePane...age_Organizer/ What I am doing wrong?
I have the following code. Mainly I am trying to display something like this: https://examples1.ext.net/#/TreePane...age_Organizer/ What I am doing wrong?
cimages is a list of an object composed of and URL and a Name.
DataView dataview = new DataView();
Store store = new Store();
store.DataSource = cimages;
store.DataBind();
XTemplate xTemplate = new XTemplate();
xTemplate.CustomConfig.Add(new ConfigItem("html", "['<ul class=\"\">','<tpl for=\".\">','<li><div class=\"\"><img src=\"{Url}\"></div><span>{Name}</span></li>','</tpl>','</ul>','']", ParameterMode.Raw));
dataview.Template.Text = xTemplate.Text;
dataview.StoreID = store.ID;
dataview.ItemSelector = "div";
dataview.StyleSpec = "overflow:auto";
dataview.MultiSelect = true;
_leftPanel.Items.Add(dataview);
I am getting this error: The Template can't be empty