or
| using System; |
| using System.Collections.Generic; |
| using System.Linq; |
| using System.Web; |
| using System.Web.Services; |
| using Telerik.Web.UI; |
| using System.Collections; |
| using System.Runtime.Serialization; |
| using System.Runtime.Serialization.Formatters.Soap; |
| namespace testCombo |
| { |
| /// <summary> |
| /// Summary description for TestWebService |
| /// </summary> |
| [WebService(Namespace = "http://tempuri.org/")] |
| [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] |
| [System.ComponentModel.ToolboxItem(false)] |
| // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. |
| //[System.Web.Script.Services.ScriptService] |
| public class TestWebService : System.Web.Services.WebService |
| { |
| [WebMethod] |
| public IEnumerable GetItems(RadComboBoxContext context) |
| { |
| int numberOfItems = 1000; |
| List<ComboBoxItemData> items = new List<ComboBoxItemData>(); |
| for (int i = 0; i < numberOfItems; i++) |
| { |
| ComboBoxItemData itemData = new ComboBoxItemData(); |
| itemData.Text = "Item " + i; |
| items.Add(itemData); |
| } |
| return items; |
| } |
| class ComboBoxItemData |
| { |
| private string text; |
| public string Text |
| { |
| get { return text; } |
| set { text = value; } |
| } |
| } |
| } |
| } |
| <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="testCombo._Default" %> |
| <%@ 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> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <div> |
| <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> |
| </telerik:RadScriptManager> |
| <telerik:RadComboBox ID="RadComboBox1" runat="server" |
| EnableLoadOnDemand="true"> |
| <ExpandAnimation Type="none" /> |
| <CollapseAnimation Type="none" /> |
| <WebServiceSettings Path="TestWebService.asmx" Method="GetItems" /> |
| </telerik:RadComboBox> |
| </div> |
| </form> |
| </body> |
| </html> |
| protected void RadGrid1_ExcelExportCellFormatting(object source, ExcelExportCellFormattingEventArgs e) |
| { |
| GridDataItem item = e.Cell.Parent as GridDataItem; |
| item.Style["background-color"] = "#ffffff"; |
| item.Style["font-size"] = "11px"; |
| item.Style["font-family"] = "Verdana"; |
| } |

| protected void tabTreeView_OnDataBound(object sender, EventArgs e) |
| { |
| RadTreeViewContextMenu contextMenu = new RadTreeViewContextMenu(); |
| contextMenu.DataFieldID = "MenuItemId"; |
| contextMenu.DataFieldParentID = "ParentId"; |
| contextMenu.DataTextField = "DisplayText"; |
| contextMenu.DataValueField = "DisplayText"; |
| contextMenu.DataSource = this.GetUnusedMenuItems(); |
| contextMenu.DataBind(); |
| tabTreeView.ContextMenus.Add(contextMenu); |
| } |

When opening a RadWindow for the second time, it throws an Unspecified Error.
function
OpenNewLocationWindow(Location, StopOffNum, url, offsetElementID) {
if (StopOffNum == null)
StopOffNum = 0;
StopValue = StopOffNum;
if (url == null)
url =
"../../CustomerWebUI/NewLocations/CreateNewIntransShipperLocation.aspx";
var oWnd = radopen(url + "?Location=" + Location + "&SeqNum=" + StopOffNum, "RadWindow1");
if (offsetElementID != null) {
oWnd.set_offsetElementID(offsetElementID);
}
}
If the offsetElementID exists, the error is thrown. If the offsetElementID does not exist, the program functions properly however the placement of the window is at the bottom of the page and the user must scroll down to find the window.
| <rad:RadAjaxManager ID="AjaxManager1" runat="server"> |
| <AjaxSettings> |
| <rad:AjaxSetting AjaxControlID="grdCustomerAssignments"> |
| <UpdatedControls> |
| <rad:AjaxUpdatedControl ControlID="pnlCustomerAssignments"/> |
| </UpdatedControls> |
| </rad:AjaxSetting> |
| <rad:AjaxSetting AjaxControlID="grdCustomerAssignments"> |
| <UpdatedControls> |
| <rad:AjaxUpdatedControl ControlID="pnlDetails" /> |
| </UpdatedControls> |
| </rad:AjaxSetting> |
| </AjaxSettings> |
| <ClientEvents OnResponseEnd="ResponseEnd" OnRequestStart="RequestStart" /> |
| <asp:Panel ID="pnlCustomerAssignments" runat="server" > |
| <rad:RadGrid ID="grdCustomerAssignments" runat="server" Skin="WebBlue" AutoGenerateColumns="false" AllowMultiRowSelection="false" |
| OnNeedDataSource="grdCustomerAssignments_NeedDataSource" |
| OnSelectedIndexChanged="grdCustomerAssignments_SelectedIndexChanged"> |
| <ClientSettings EnablePostBackOnRowClick="true" > |
| <ClientEvents OnRowSelected="RowSelected"/> |
| <Scrolling AllowScroll="true" ScrollHeight="350" UseStaticHeaders="true" SaveScrollPosition="true" /> |
| <Selecting AllowRowSelect="true" /> |
| <Resizing AllowColumnResize="true" /> |
| </ClientSettings> |
| <MasterTableView DataKeyNames="ID" > |
| <HeaderStyle Wrap="false" HorizontalAlign="Center" VerticalAlign="Middle" Font-Bold="true" /> |
| <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="false" /> |
| <AlternatingItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="false" /> |
| <NoRecordsTemplate> |
| <div style="font-size:80%; color:Maroon;">No Items Were Found</div> |
| </NoRecordsTemplate> |
| </MasterTableView> |
| </rad:RadGrid> |
| </asp:Panel> |
| <rad:RadCodeBlock ID="RadCodeBlock1" runat="server"> |
| <script type="text/javascript"> |
| var grid1; |
| Sys.Application.add_load(function() { |
| grid1 = $find('<%= grdCustomerAssignments.ClientID %>'); |
| var tmp = "asdf"; |
| }); |
| var SelectedItemIsReseting = false; |
| var SelectedIndexes = new Object(); |
| function RowSelected(sender, eventArgs) { |
| if (!SelectedItemIsReseting) { |
| SelectedIndexes = eventArgs.get_itemIndexHierarchical(); |
| } |
| } |
| function RequestStart(sender, eventArgs) { |
| if (SelectedItemIsReseting) { |
| eventArgs.set_cancel(true); |
| } |
| } |
| </script> |
| </rad:RadCodeBlock> |
| <rad:RadScriptBlock ID="RadScriptBlock1" runat="server"> |
| <script type="text/javascript"> |
| function ResponseEnd(sender, eventArgs) { |
| SelectedItemIsReseting = true; |
| var gridID = eventArgs.get_eventTargetElement().id; |
| var grid = $find(gridID); |
| if (!grid) alert("No Grid"); |
| var MasterTableView = grid.get_masterTableView(); |
| if (!MasterTableView) alert("No Table"); |
| MasterTableView.selectItem(MasterTableView.get_dataItems()[SelectedIndexes].get_element()); |
| SelectedItemIsReseting = false; |
| clearTimeout(t); |
| } |
| </script> |
| </rad:RadScriptBlock> |