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" />
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px" />
</ExpandCollapseColumn>
<Columns>
<telerik:GridBoundColumn DataField="LastName" HeaderText="Last Name ">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name ">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="HomePhone" HeaderText="Phone">
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
<ClientSettings EnableRowHoverStyle="true">
<Selecting AllowRowSelect="True" />
<ClientEvents OnRowSelected="onRowSelected" />
</ClientSettings>
<FilterMenu EnableTheming="True" Skin="Inox">
<CollapseAnimation Duration="200" Type="OutQuint" />
</FilterMenu>
</telerik:RadGrid>
</div>
<asp:SqlDataSource runat="server" ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT [LastName], [FirstName], [HomePhone] FROM [Employees]"></asp:SqlDataSource>
</ItemTemplate>
<Items>
<telerik:RadComboBoxItem ></telerik:RadComboBoxItem>
</Items>
</telerik:RadComboBox>
[解决办法]
这个是telerik 公司的产品,你没有买,是用不了的,官网上有试用版
[解决办法]
这是第三方控件 又不是 asp.net 自带的东西