日期:2014-05-17  浏览次数:20411 次

ajax中 combobox怎么显示两列数据呢
ajax中有一个combobox控件,能不能显示两列数据呢?我看官网上有这样的例子,但是我照搬过来的时候却有问题,
这是网上的代码
HTML code
<telerik:RadComboBox ID="RadComboBoxProduct" runat="server" Height="200px" Width="200px"
                            DropDownWidth="298px" EmptyMessage="Choose a Product" HighlightTemplatedItems="true"
                            EnableLoadOnDemand="true" Filter="StartsWith" OnItemsRequested="RadComboBoxProduct_ItemsRequested">
                            <HeaderTemplate>
                                <table style="width: 275px" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td style="width: 177px;">
                                            Product Name</td>
                                        <td style="width: 60px;">
                                            Quantity</td>
                                        <td style="width: 40px;">
                                            Price</td>
                                    </tr>
                                </table>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <table style="width: 275px" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td style="width: 177px;">
                                            <%# DataBinder.Eval(Container, "Text")%>
                                        </td>
                                        <td style="width: 60px;">
                                            <%# DataBinder.Eval(Container, "Attributes['UnitsInStock']")%>
                                        </td>
                                        <td style="width: 40px;">
                                            <%# DataBinder.Eval(Container, "Attributes['UnitPrice']")%>
                                        </td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                        </telerik:RadComboBox>


但是在VS2010上面会出错, 好像一个是没有 <HeaderTemplate> 这一类的东东的。

或者 怎么样做才能显示两例数据,有什么别的好办法?

------解决方案--------------------
<telerik:RadComboBox ID="RadComboBox_Initiator" runat="server" Width="210px" DropDownWidth="270px"
ShowToggleImage="True" Skin="Inox" >

<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
<ItemTemplate>
<div id="div4">
<telerik:RadGrid runat="server" ID="RadGrid1" Skin="Inox" DataSourceID="SqlDataSource1"
AutoGenerateColumns="False" CssClass="InitiatorSelector" 
AllowMultiRowSelection="True" AllowPaging="True" GridLines="None" PageSize="5">
<MasterTableView ClientDataKeyNames="FirstName">
<RowIndicatorColumn>
<HeaderStyle Width="20px" />