我創建具有類似這樣的標記添加項目Sitecore的組合框
<WizardFormIndent>
<GridPanel ID="FieldsAction" Columns="2" Width="100%" CellPadding="2">
<Literal Text="Brand:" GridPanel.NoWrap="true" Width="100%" />
<Combobox ID="Brand" GridPanel.Width="100%" Width="100%">
<!-- Leave empty as I want to populate available options in code -->
</Combobox>
<!-- Etc. -->
</WizardFormIndent>
一個Sitecore的純粹的UI嚮導,但我似乎無法找到一種方法來在代碼中添加選項組合框「品牌」的旁邊。有誰知道如何完成下面的代碼?
[Serializable]
public class MySitecorePage : WizardForm
{
// Filled in by the sheer UI framework
protected ComboBox Brands;
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
if (!Context.ClientPage.IsEvent)
{
IEnumerable<Brand> brandsInSqlDb = GetBrands();
// this.Brands doesn't seem to have any methods
// to add options
}
}
}
謝謝,這個工作很完美 – 2013-03-07 13:55:01