Jun 26, 2009, 11:32 AM
Store - load from Object if Datasource is empty - ComboBox Template empty?
I have a ComboBox with a template - I have the datasource of teh store tied to a datatable - if the datatable is empty, I wanted to load in some items from an object - but when I do, the cb template is essentially empty - I assume that the object is not passing in field names or something?
<Template ID="Template1" runat="server">
<tpl for=".">
<div class="list-item">
<h3>{contractNumber} - {insuranceCompanyName}</h3>
Total Charge: {totalCharge:usMoney}
</tpl>
</Template>
<Listeners>
And here is my code-behindif (dt.Rows.Count <= 0)
{
//this.ScriptManager1.AddScript("alert('Empty');");
this.storeContracts.DataSource = new object[]
{
new object[]{1, "MCR", "Medicare", 0, "MCR - Medicare"},
};
this.storeContracts.DataBind();
}
else
{
this.storeContracts.DataSource = dt.DefaultView;
this.storeContracts.DataBind();
}