locked
How can I use a late bound attribute as the DataTextField of a combobox in asp.net? RRS feed

  • Question

  • Relevant snipped from my aspx page:

    <telerik:RadComboBox runat="server" AutoPostBack="True" ID="CboLists" EmptyMessage="Kies een marketinglijst"
             DataValueField="Id" HighlightTemplatedItems="True" OnSelectedIndexChanged="CboLists_OnSelectedIndexChanged"
            Width="200px" DataSourceID="MarketingListDataSource" DataTextField="<!--What do I enter here?-->"> 
            <ItemTemplate>
                <table>
                    <tr>
                        <td>
                           <b><%# DataBinder.Eval(Container.DataItem, "Attributes['listname']") %></b> (<%# ViewHelper.GetBooleanValue("list", "type",(bool)((Entity)Container.DataItem).Attributes["type"]) %>)
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <%# DataBinder.Eval(Container.DataItem, "Attributes['membercount']") %> Leden
                        </td>
                    </tr>
                </table>
            </ItemTemplate>
        </telerik:RadComboBox>
        <asp:ObjectDataSource runat="server" ID="MarketingListDataSource" TypeName="aca.crm2011.sendgrid.MarketingListEngine"
             OnObjectCreating="MarketingListDataSource_OnObjectCreating" SelectMethod="GetAllMarketingLists"/>

    I want to display the listname as the DataTextField of my combobox. Is there a way to do this without using early binding?

    Wednesday, June 25, 2014 1:00 PM