(p_Postback_Click is just an empty event handler to cause a postback):<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestClearSelection.aspx.cs" Inherits="TestClearSelection" %><%@ 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"> <script type="text/javascript"> function ClearListbox() { lb = $find("RadListBox1"); lb.clearSelection(); } </script> <ajax:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true"></ajax:ScriptManager> <div> <telerik:RadListBox ID="RadListBox1" runat="server"> <Items> <telerik:RadListBoxItem Text="Item 1" /> <telerik:RadListBoxItem Text="Item 2" /> <telerik:RadListBoxItem Text="Item 3" /> </Items> </telerik:RadListBox> <asp:Button ID="b_ClearSelection" runat="server" Text="Clear Selection" onclientclick="ClearListbox(); return false;" /> <asp:Button ID="b_PostBack" runat="server" Text="Postback" onclick="b_PostBack_Click" /> </div> </form></body></html>
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="TransferItemGrid.ascx.cs" Inherits="Viewers_TransferItemGrid" %><telerik:RadAjaxLoadingPanel ID="loadPanelQueuedFiles" runat="server" Height="75px" Width="75px" Transparency="5"> <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' style="border: 0;" /> </telerik:RadAjaxLoadingPanel><telerik:RadGrid ID="radGridFileTransfers" runat="server" Skin="Windows7" OnNeedDataSource="OnGridNeedDataSource" Width="95%" EnableViewState="true"> <MasterTableView TableLayout="Auto" AutoGenerateColumns="false" AllowSorting="true" AllowPaging="true"> <Columns> <telerik:GridHyperLinkColumn DataTextField="PlayerName" HeaderText="Player" DataNavigateUrlFields="PlayerId" DataNavigateUrlFormatString="~/Admin/PlayerDiagnostics.aspx?playerid={0}" SortExpression="PlayerName" /> <telerik:GridBoundColumn DataField="Name" HeaderText="File" SortExpression="Name" /> <telerik:GridBoundColumn DataField="TransferType" HeaderText="Transfer Type" /> <telerik:GridBoundColumn DataField="Status" HeaderText="Status" /> <telerik:GridBoundColumn DataField="PercentageDownloaded" HeaderText="Downloaded %" /> <telerik:GridBoundColumn DataField="FileSize" HeaderText="Size" /> </Columns> </MasterTableView> </telerik:RadGrid>using System;using System.Collections.Generic;using WebsitePresentationLayer;using Telerik.Web.UI;public partial class Viewers_TransferItemGrid : System.Web.UI.UserControl{ public Viewers_TransferItemGrid() { this.IsPlayerColumnVisible = true; } protected override void OnLoad(EventArgs e) { base.OnLoad(e); } protected override void OnInit(EventArgs e) { base.OnInit(e); SetupAjax(); } private void SetupAjax() { CmsPage cmsPage = (CmsPage)(this.Page); var ajaxSetting = new AjaxSetting(this.radGridFileTransfers.ID); ajaxSetting.UpdatedControls.Add(new AjaxUpdatedControl(this.radGridFileTransfers.ID, this.loadPanelQueuedFiles.ID)); cmsPage.RadAjaxManager.AjaxSettings.Add(ajaxSetting); } protected void Page_Load(object sender, EventArgs e) { } private IEnumerable<TransferTableRow> _transferTableRows; public IEnumerable<TransferTableRow> TransferTableRows { get { return _transferTableRows; } set { // There was a problem that the grid would become blank in the playerdiagnostics page // when the Refresh button was pressed _transferTableRows = value; this.radGridFileTransfers.DataSource = _transferTableRows; this.radGridFileTransfers.DataBind(); } } public bool IsPlayerColumnVisible { get; set; } public const int PLAYER_COLUMN_INDEX = 0; protected override void OnPreRender(EventArgs e) { var playerColumn = this.radGridFileTransfers.Columns[PLAYER_COLUMN_INDEX]; playerColumn.Visible = this.IsPlayerColumnVisible; } protected virtual void OnGridNeedDataSource(object sender, GridNeedDataSourceEventArgs e) { this.radGridFileTransfers.DataSource = this.TransferTableRows; }}public static void RegisterRoutes(RouteCollection routes){ routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.IgnoreRoute("{resource}.aspx/{*pathInfo}"); routes.IgnoreRoute("{resource}.ashx/{*pathInfo}"); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults );}<?xml version="1.0" encoding="UTF-8"?><configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"> <system.web> <httpModules> <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule, Telerik.Web.UI"/> <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> </httpModules> <httpHandlers> <add verb="*" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler, Telerik.Web.UI"/> <remove verb="*" path="*.asmx"/> <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/> </httpHandlers> <httpRuntime maxRequestLength="102400" executionTimeout="3600"/> <compilation defaultLanguage="c#" debug="true" targetFramework="4.0"> <assemblies> <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add assembly="System.Web.Abstractions,Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add assembly="System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> </assemblies> </compilation> <customErrors mode="Off" defaultRedirect="~/error.aspx"> <error statusCode="404" redirect="~/errorPageNotFound.aspx" /> </customErrors> <membership defaultProvider="BWMembershipProvider"> <providers> <clear /> <add name="BWMembershipProvider" type="BigWave.Web.BWMembershipProvider" /> </providers> </membership> <authentication mode="Forms"> <!--timeout is set to a value greater than a day. acual timeout value is controlled by the cookie set during the login process--> <forms name="BigWave" loginUrl="login.aspx" defaultUrl="default.aspx" protection="All" timeout="200" slidingExpiration="true" path="/; HttpOnly" /> </authentication> <authorization> <allow users="*" /> </authorization> <trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true"/> <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="45"/> <globalization requestEncoding="utf-8" responseEncoding="utf-8"/> <pages viewStateEncryptionMode="Never" enableEventValidation="false" controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"> <namespaces> <add namespace="System.Web.Helpers" /> <add namespace="System.Web.Mvc" /> <add namespace="System.Web.Mvc.Ajax" /> <add namespace="System.Web.Mvc.Html" /> <add namespace="System.Web.Routing" /> <add namespace="System.Web.WebPages" /> </namespaces> </pages> </system.web> <system.webServer> <validation validateIntegratedModeConfiguration="false"/> <modules> <remove name="ScriptModule"/> <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <!-- ******* Register the RadUploadModule for IIS 7 ****** --> <add name="RadUploadModule" preCondition="integratedMode" type="Telerik.Web.UI.RadUploadHttpModule" /> </modules> <handlers> <remove name="ScriptHandlerFactory"/> <remove name="ScriptHandlerFactoryAppServices"/> <remove name="ScriptResource"/> <remove name="WebServiceHandlerFactory-Integrated"/> <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <!-- ******* Register the RadUploadProgressHandler for IIS 7 ****** --> <add name="Telerik_RadUploadProgressHandler_ashx" verb="*" preCondition="integratedMode" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" /> </handlers> </system.webServer> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /> <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" /> </dependentAssembly> </assemblyBinding> </runtime> <location path="Telerik.RadUploadProgressHandler.ashx"> <system.web> <authorization> <allow users="*" /> </authorization> </system.web> </location></configuration>
<telerik:RadGrid ID="ColumnRadGrid" runat="server"
AllowAutomaticUpdates="True"
AllowFilteringByColumn="false"
AllowMultiRowSelection="true"
AllowSorting="false"
AutoGenerateColumns="false"
ClientSettings-AllowColumnsReorder="false"
Height="100%"
OnItemCreated="ColumnRadGrid_ItemCreated"
OnItemUpdated="ColumnRadGrid_ItemUpdated"
OnNeedDataSource="ColumnRadGrid_NeedDataSource"
ShowHeader="true"
TabIndex="6"
Visible="True"
Width="100%">
<ClientSettings AllowKeyboardNavigation="true" EnableRowHoverStyle="false" >
<Selecting AllowRowSelect="True" />
<ClientEvents OnRowDblClick="ColumnRowDblClick" OnRowClick="RowClick"
OnGridCreated="GridCreated" OnCommand="GridCommand" />
<Scrolling AllowScroll="True" UseStaticHeaders="True" />
</ClientSettings>
<MasterTableView BorderWidth="1" EditMode="InPlace" GridLines="Vertical" TableLayout="Fixed" Height="100%" Width="100%">
<Columns>
<telerik:GridBoundColumn
DataField="ColumnName"
HeaderText="Data Field"
ItemStyle-Wrap="False"
ReadOnly="True"
UniqueName="columnName" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn
ColumnEditorID="GridTextBoxColumnEditor"
DataField="Alias"
HeaderText="Column Alias"
ItemStyle-Wrap="False"
UniqueName="columnAlias" >
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn
HeaderStyle-Width="100px"
HeaderText="Show Option"
ItemStyle-Width="100px"
ItemStyle-Wrap="False"
UniqueName="showOption" >
<ItemTemplate>
<asp:Label ID="ColumnRadGridShowLabel" runat="server" Text='<%#Eval("ShowText") %>' ClientIDMode="Static">
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadComboBox ID="ColumnRadGridShowComboBox" runat="server" ClientIDMode="Static" Width="90px">
</telerik:RadComboBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn
HeaderStyle-Width="135px"
HeaderText="Sort Option"
ItemStyle-Width="135px"
ItemStyle-Wrap="False"
UniqueName="sortOption" >
<ItemTemplate>
<asp:Label ID="ColumnRadGridSortLabel" runat="server" Text='<%#Eval("SortText") %>' ClientIDMode="Static">
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadComboBox ID="ColumnRadGridSortComboBox" runat="server" ClientIDMode="Static" Width="125px">
</telerik:RadComboBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
<telerik:GridTextBoxColumnEditor ID="GridTextBoxColumnEditor" runat="server" TextBoxStyle-Width="165px" />

Protected Sub ButtonPreviewWindow_OnClick(ByVal sender As Object, ByVal e As System.EventArgs) 'keep the modal popup showing ModalImagePopup01.Show() Dim sbScript As New System.Text.StringBuilder() Dim strNewURL As String = "http://www.bbc.co.uk" sbScript.Append("var oWnd = $find('" & RadWindowPreviewSite.ClientID & "');") sbScript.Append("oWnd.setUrl(""" & strNewURL & """);") sbScript.Append("oWnd.setActive(true);") sbScript.Append("oWnd.show();") ScriptManager.RegisterStartupScript(Page, Me.GetType(), "key", sbScript.ToString(), True) End SubPublic Shared Sub RadWindow_ShowWindow_PreviewURL(ByVal RadWindow As RadWindow, ByVal strNewURL As String) Dim sbScript As New System.Text.StringBuilder() Dim page As Page = DirectCast(context.Handler, Page) sbScript.Append("var oWnd = $find('" & RadWindow.ClientID & "');") sbScript.Append("oWnd.setUrl("""" & strNewURL & """");") sbScript.Append("oWnd.setActive(true);") sbScript.Append("oWnd.show();") ScriptManager.RegisterStartupScript(page, GetType(Page), "key", sbScript.ToString(), True) End SubProtected Sub ButtonPreviewWindow_OnClick(ByVal sender As Object, ByVal e As System.EventArgs)TelerikFunctionality.RadWindow_ShowWindow_PreviewURL(RadWindowPreviewSite, "http://www.bbc.co.uk")End sub