I'm following the Multicolumn Combobox example I downloaded from your site.
I can get the following example to work fine on a stand alone ASPX page. When I introduce it into my environment which has Master Pages and WebUserControls I can't seem to get it working.
Here is the code. Only difference when it's moved to Masterpages/WebUserControls environment is that the Script Manager is on the main Master Page. Any ideas?
I can get the following example to work fine on a stand alone ASPX page. When I introduce it into my environment which has Master Pages and WebUserControls I can't seem to get it working.
Here is the code. Only difference when it's moved to Masterpages/WebUserControls environment is that the Script Manager is on the main Master Page. Any ideas?
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> | |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml"> | |
| <head runat="server"> | |
| <title></title> | |
| <style type="text/css"> | |
| .column | |
| { | |
| float: left; | |
| text-align: left; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <form id="form1" runat="server"> | |
| <div> | |
| <asp:ScriptManager ID="smMain" runat="server"> | |
| <Scripts> | |
| <asp:ScriptReference Path="~/js/prototype-1.6.0.2.js" /> | |
| <asp:ScriptReference Path="~/js/comboClientSide.js" /> | |
| </Scripts> | |
| </asp:ScriptManager> | |
| <script type="text/javascript"> | |
| var cb; | |
| function cb_onDataBound(pComboboxItem, pDropDownLine) { | |
| var customAttributes = pComboboxItem.get_attributes(); | |
| pDropDownLine.update( | |
| '<span class="column" style="width:180px;">' + pComboboxItem.get_text() + '</span>' | |
| + '<span class="column" style="width:100px;">' + customAttributes.getAttribute("City") + '</span>' | |
| + '<span class="column" style="width:100px;">' + customAttributes.getAttribute("Region") + '</span>' | |
| + '<span class="column" style="width:100px;">' + customAttributes.getAttribute("SubRegion") + '</span>' | |
| + '<span class="column" style="width:100px;">' + customAttributes.getAttribute("Country") + '</span>' | |
| ); | |
| } | |
| function pageLoad(sender, args) { | |
| initComboExtensions(); | |
| cb = $find("<%= RadComboBox1.ClientID %>"); | |
| cb.onDataBound = cb_onDataBound; | |
| } | |
| </script> | |
| <table border="0" width="100%" cellpadding="10px" bgcolor="#84a1c3"> | |
| <tr> | |
| <td> | |
| <font color="black"> <b>Information</b></font><br /> | |
| <br /> | |
| <hr /> | |
| </td> | |
| </tr> | |
| </table> | |
| <table border="0" width="100%" cellpadding="10px" bgcolor="#84a1c3"> | |
| <tr> | |
| <td> | |
| <br /> | |
| <telerik:RadComboBox ID="RadComboBox1" runat="server" Width="300px" Height="200px" | |
| DropDownWidth="950px" EnableLoadOnDemand="true" EnableItemCaching="true" OnClientItemsRequesting="OnClientItemsRequesting" | |
| OnClientItemsRequested="OnClientItemsRequested" OnClientDropDownOpening="OnClientDropDownOpening"> | |
| <ExpandAnimation Type="none" /> | |
| <CollapseAnimation Type="none" /> | |
| <WebServiceSettings Path="~/Inventory/Webservices/wsInventory.asmx" Method="SearchCatalog" /> | |
| <HeaderTemplate> | |
| <ul style="list-style: none"> | |
| <li><span class="column" style="width: 180px;">Name</span> <span class="column" style="width: 100px;"> | |
| City</span> <span class="column" style="width: 100px;">Region</span> <span class="column" | |
| style="width: 100px;">SubRegion</span> <span style="width: 100px;">Country</span> | |
| </li> | |
| </ul> | |
| </HeaderTemplate> | |
| </telerik:RadComboBox> | |
| </td> | |
| </tr> | |
| </table> | |
| </div> | |
| </form> | |
| </body> | |
| </html> |
| <WebMethod()> _ | |
| Public Function SearchCatalog(ByVal context As RadComboBoxContext) As RadComboBoxData | |
| Dim BLL As New Inventory | |
| Dim oDT As DataTable = BLL.SearchCatalog(context.Text) | |
| Dim comboData As New RadComboBoxData() | |
| Dim result As New List(Of RadComboBoxItemData) | |
| If Not IsNothing(oDT) Then | |
| If oDT.Rows.Count > 0 Then | |
| For Each oRow As DataRow In oDT.Rows | |
| Dim itemData As New RadComboBoxItemData() | |
| itemData.Text = oRow("Name").ToString() | |
| itemData.Value = oRow("CatalogID").ToString() | |
| itemData.Attributes("City") = oRow("City").ToString() | |
| itemData.Attributes("Region") = oRow("Region").ToString() | |
| itemData.Attributes("SubRegion") = oRow("SubRegion").ToString() | |
| itemData.Attributes("Country") = oRow("Country").ToString() | |
| result.Add(itemData) | |
| Next | |
| Else | |
| Dim itemData As New RadComboBoxItemData() | |
| itemData.Text = "No Results..." | |
| itemData.Value = "0" | |
| itemData.Attributes("City") = "" | |
| itemData.Attributes("Region") = "" | |
| itemData.Attributes("SubRegion") = "" | |
| itemData.Attributes("Country") = "" | |
| result.Add(itemData) | |
| End If | |
| End If | |
| comboData.Items = result.ToArray() | |
| Return comboData | |
| End Function |