Hi,
If I try to emit javascript in a EditTemplate column with the Radgrid inside a RadAjaxPanel, the javascript never executes, is completed ignored. If the RadAjaxPanel is removed, when the grid enters in edit mode the javascript runs correctly. (I have tested this in I.E 9)
Is it missing some additional configuration?
example:
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"> </telerik:RadScriptManager> <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" HorizontalAlign="NotSet"> <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" CellSpacing="0" GridLines="None" OnNeedDataSource="RadGrid1_NeedDataSource" OnUpdateCommand="RadGrid1_UpdateCommand"> <ClientSettings AllowExpandCollapse="true"> <Selecting AllowRowSelect="true" /> </ClientSettings> <MasterTableView> <Columns> <telerik:GridEditCommandColumn ButtonType="ImageButton" /> <telerik:GridTemplateColumn HeaderText="Test" UniqueName="TemplateColumn"> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Eval("Name") %>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <script type="text/javascript"> alert('Started Edit mode'); </script> </EditItemTemplate> </telerik:GridTemplateColumn> </Columns> </MasterTableView> </telerik:RadGrid> </telerik:RadAjaxPanel>
Best Regards
Ricardo Rocha
<telerik:RadAsyncUpload MaxFileInputsCount="1" MaxFileSize="2097152" AllowedFileExtensions="bmp,jpg,jpeg,gif,png" ID="ImageAsyncUpload" OnFileUploaded="PhotoUploaded" TargetFolder="~/Test" OnClientFileUploadFailed="OnPhotoUploadFailed" OnClientFileSelected="OnPhotoSelected" OnClientValidationFailed="PhotoValidationFailed" OnClientFileUploaded="OnPhotoUploaded" runat="server"></telerik:RadAsyncUpload>| /* <RadMenu / Default> */ |
| .RadMenu_MyCustomSkin .rmRootGroup, |
| .RadMenu_MyCustomSkin .rmLink, |
| .RadMenu_MyCustomSkin .rmText, |
| .RadMenu_MyCustomSkin .rmLeftArrow, |
| .RadMenu_MyCustomSkin .rmRightArrow, |
| .RadMenu_MyCustomSkin .rmTopArrow, |
| .RadMenu_MyCustomSkin .rmBottomArrow |
| { |
| } |
| .RadMenu_MyCustomSkin .rmRootGroup |
| { |
| background-position: 0 -408px; |
| } |
| /* <Root items> */ |
| .RadMenu_MyCustomSkin, |
| .RadMenu_MyCustomSkin .rmLink |
| { |
| font-family: Verdana, Arial, Helvetica, sans-serif; |
| font-size: 11px; |
| color: #5b3b23; |
| line-height: 10px; |
| text-decoration: none; |
| border-bottom-width: 1px; |
| } |
| .RadMenu_MyCustomSkin .rmLink, |
| .RadMenu_MyCustomSkin .rmDisabled, |
| .RadMenu_MyCustomSkin .rmDisabled:hover |
| { |
| background-position: 0 -72px; |
| } |
| .RadMenu_MyCustomSkin .rmText, |
| .RadMenu_MyCustomSkin .rmDisabled .rmText, |
| .RadMenu_MyCustomSkin .rmDisabled:hover .rmText |
| { |
| background-position: 100% -96px; |
| } |
| .RadMenu_MyCustomSkin .rmFirst .rmLink, |
| .RadMenu_MyCustomSkin .rmFirst .rmLink:hover, |
| .RadMenu_MyCustomSkin .rmLast .rmText, |
| .RadMenu_MyCustomSkin .rmLast .rmLink:hover .rmText, |
| .RadMenu_MyCustomSkin .rmVertical .rmLink, |
| .RadMenu_MyCustomSkin .rmVertical .rmText |
| { |
| background-repeat: no-repeat; |
| background-position: 0 500px; |
| } |
| .RadMenu_MyCustomSkin .rmVertical .rmFirst, |
| .RadMenu_MyCustomSkin .rmVertical .rmLast |
| { |
| background: none; |
| } |
| .RadMenu_MyCustomSkin .rmLink:hover, |
| .RadMenu_MyCustomSkin .rmFocused |
| { |
| color: #ad9d91; |
| text-decoration:none; |
| border-bottom-style: none; |
| border-bottom-style: dashed; |
| border-bottom-color: #FFFFFF; |
| } |
| .RadMenu_MyCustomSkin .rmVertical .rmLink |
| { |
| border-bottom-style: dashed; |
| border-bottom-color: #FFFFFF; |
| padding-top: 10px; |
| padding-bottom: 15px; |
| } |
| .RadMenu_MyCustomSkin .rmVertical .rmLast .rmLink |
| { |
| border-bottom-width: 0px; |
| border-bottom-style: none; |
| } |
| .RadMenu_MyCustomSkin .rmVertical .rmLink:hover, |
| .RadMenu_MyCustomSkin .rmVertical .rmFocused, |
| .RadMenu_MyCustomSkin .rmVertical .rmExpanded, |
| .RadMenu_MyCustomSkin .rmVertical .rmExpanded:hover |
| { |
| } |
| .RadMenu_MyCustomSkin .rmVertical .rmFirst .rmLink:hover, |
| .RadMenu_MyCustomSkin .rmVertical .rmFirst .rmFocused, |
| .RadMenu_MyCustomSkin .rmVertical .rmFirst .rmExpanded, |
| .RadMenu_MyCustomSkin .rmVertical .rmFirst .rmExpanded:hover |
| { |
| } |
| .RadMenu_MyCustomSkin .rmVertical .rmLast .rmLink:hover, |
| .RadMenu_MyCustomSkin .rmVertical .rmLast .rmFocused, |
| .RadMenu_MyCustomSkin .rmVertical .rmLast .rmExpanded, |
| .RadMenu_MyCustomSkin .rmVertical .rmLast .rmExpanded:hover |
| { |
| } |
| .RadMenu_MyCustomSkin .rmVertical .rmItem .rmDisabled:hover |
| { |
| padding-top: 1px; |
| padding-bottom: 1px; |
| border-width: 0; |
| } |
| .RadMenu_MyCustomSkin .rmExpanded, |
| .RadMenu_MyCustomSkin .rmExpanded:hover |
| { |
| background-color: #e3f3f4; |
| background-position: 0 -72px; |
| } |
| .RadMenu_MyCustomSkin .rmExpanded .rmText, |
| .RadMenu_MyCustomSkin .rmExpanded:hover .rmText |
| { |
| background-position: 100% -96px; |
| } |
| .RadMenu_MyCustomSkin .rmLast .rmExpanded .rmText |
| { |
| background-position: 0 500px; |
| background-repeat: no-repeat; |
| } |
| .RadMenu_MyCustomSkin .rmDisabled, |
| .RadMenu_MyCustomSkin .rmDisabled:hover |
| { |
| color: #7d7d7d; |
| background-color: transparent; |
| } |
| /* </Root items> */ |
| /* <Submenu items> */ |
| .RadMenu_MyCustomSkin .rmGroup, |
| .RadMenu_MyCustomSkin .rmGroup .rmVertical |
| { |
| background-color: #E7F5F5; |
| } |
| .RadMenu_MyCustomSkin .rmGroup .rmItem .rmLink |
| { |
| border-bottom-style: dashed; |
| border-bottom-color: #FFFFFF; |
| padding-top: 10px; |
| padding-bottom: 15px; |
| } |
| .RadMenu_MyCustomSkin .rmGroup .rmItem .rmLast .rmLink |
| { |
| border-bottom-style: none; |
| } |
| .RadMenu_MyCustomSkin .rmSlide .rmScrollWrap |
| { |
| background-image: none; |
| } |
| .RadMenu_MyCustomSkin_rtl .rmGroup, |
| .RadMenu_MyCustomSkin_rtl .rmGroup .rmVertical |
| { |
| background-position: 100% 0; |
| } |
| .RadMenu_MyCustomSkin .rmRootGroup li.rmItem .rmGroup |
| { |
| padding-bottom: 0; |
| } |
| .RadMenu_MyCustomSkin .rmRootGroup .rmHorizontal |
| { |
| background-image: none; |
| } |
| .RadMenu_MyCustomSkin .rmScrollWrap .rmVertical |
| { |
| border: 0; |
| } |
| .RadMenu_MyCustomSkin .rmGroup .rmItem .rmLink, |
| .RadMenu_MyCustomSkin .rmGroup .rmItem .rmLink:hover, |
| .RadMenu_MyCustomSkin .rmGroup .rmItem .rmFocused, |
| .RadMenu_MyCustomSkin .rmGroup .rmItem .rmExpanded |
| { |
| } |
| .RadMenu_MyCustomSkin .rmGroup .rmLast .rmLink, |
| .RadMenu_MyCustomSkin .rmGroup .rmLast .rmLink:hover, |
| .RadMenu_MyCustomSkin .rmGroup .rmLast .rmFocused, |
| .RadMenu_MyCustomSkin .rmGroup .rmLast .rmExpanded |
| { |
| } |
| .RadMenu_MyCustomSkin .rmGroup .rmLink, |
| .RadMenu_MyCustomSkin .rmGroup .rmText, |
| .RadMenu_MyCustomSkin .rmGroup .rmItem .rmDisabled, |
| .RadMenu_MyCustomSkin .rmGroup .rmItem .rmDisabled:hover, |
| .RadMenu_MyCustomSkin .rmGroup .rmItem .rmDisabled .rmText, |
| .RadMenu_MyCustomSkin .rmGroup .rmItem .rmDisabled:hover .rmText |
| { |
| } |
| .RadMenu_MyCustomSkin .rmGroup .rmLink:hover, |
| .RadMenu_MyCustomSkin .rmGroup .rmFocused, |
| .RadMenu_MyCustomSkin .rmGroup .rmExpanded |
| { |
| background-position: 0 -168px; |
| } |
| .RadMenu_MyCustomSkin .rmGroup .rmLink:hover .rmText, |
| .RadMenu_MyCustomSkin .rmGroup .rmFocused .rmText, |
| .RadMenu_MyCustomSkin .rmGroup .rmExpanded .rmText |
| { |
| background-position: 100% -192px; |
| } |
| /* <expand arrows> */ |
| .RadMenu_MyCustomSkin .rmGroup .rmExpandRight, |
| .RadMenu_MyCustomSkin .rmGroup .rmExpandDown, |
| .RadMenu_MyCustomSkin .rmGroup .rmItem .rmDisabled .rmExpandRight, |
| .RadMenu_MyCustomSkin .rmGroup .rmItem .rmDisabled .rmExpandDown, |
| .RadMenu_MyCustomSkin .rmGroup .rmItem .rmDisabled:hover .rmExpandRight, |
| .RadMenu_MyCustomSkin .rmGroup .rmItem .rmDisabled:hover .rmExpandDown |
| { |
| background-position: 100% -216px; |
| } |
| .RadMenu_MyCustomSkin .rmGroup .rmLink:hover .rmExpandRight, |
| .RadMenu_MyCustomSkin .rmGroup .rmFocused .rmExpandRight, |
| .RadMenu_MyCustomSkin .rmGroup .rmExpanded .rmExpandRight, |
| .RadMenu_MyCustomSkin .rmGroup .rmLink:hover .rmExpandDown, |
| .RadMenu_MyCustomSkin .rmGroup .rmFocused .rmExpandDown, |
| .RadMenu_MyCustomSkin .rmGroup .rmExpanded .rmExpandDown |
| { |
| background-position: 100% -240px; |
| } |
| .RadMenu_MyCustomSkin .rmGroup .rmDisabled:hover .rmExpandRight, |
| .RadMenu_MyCustomSkin .rmGroup .rmDisabled:hover .rmExpandDown |
| { |
| background-position: 100% -216px; |
| } |
| /* </expand arrows> */ |
| /* <rtl> */ |
| .RadMenu_MyCustomSkin_rtl .rmLink |
| { |
| background-position: 100% -96px; |
| } |
| .RadMenu_MyCustomSkin_rtl .rmText |
| { |
| background-position: 0 -72px; |
| } |
| .RadMenu_MyCustomSkin_rtl .rmVertical .rmExpanded .rmText, |
| .RadMenu_MyCustomSkin_rtl .rmVertical .rmExpanded:hover .rmText |
| { |
| background-position: 0 500px; |
| background-repeat: no-repeat; |
| } |
| .RadMenu_MyCustomSkin_rtl .rmGroup .rmLink:hover, |
| .RadMenu_MyCustomSkin_rtl .rmGroup .rmFocused, |
| .RadMenu_MyCustomSkin_rtl .rmGroup .rmExpanded |
| { |
| background-position: 100% -264px; |
| } |
| .RadMenu_MyCustomSkin_rtl .rmGroup .rmLink:hover .rmText, |
| .RadMenu_MyCustomSkin_rtl .rmGroup .rmFocused .rmText, |
| .RadMenu_MyCustomSkin_rtl .rmGroup .rmExpanded .rmText |
| { |
| background-position: 0 -288px; |
| } |
| .RadMenu_MyCustomSkin_rtl .rmGroup .rmExpandLeft |
| { |
| background-position: 0 -312px; |
| } |
| .RadMenu_MyCustomSkin_rtl .rmGroup .rmLink:hover .rmExpandLeft, |
| .RadMenu_MyCustomSkin_rtl .rmGroup .rmFocused .rmExpandLeft, |
| .RadMenu_MyCustomSkin_rtl .rmGroup .rmExpanded .rmExpandLeft |
| { |
| background-position: 0 -336px; |
| } |
| /* </rtl> */ |
| /* </Submenu items> */ |
| /* <Submenu offsets (Default - specific, overlapping submenus)> */ |
| .RadMenu_MyCustomSkin .rmSlide |
| { |
| margin: 0 0 0 -1px; |
| } |
| .RadMenu_MyCustomSkin .rmVertical .rmSlide, |
| .RadMenu_MyCustomSkin .rmSlide .rmSlide, |
| .RadMenu_MyCustomSkin_Context .rmGroup .rmSlide |
| { |
| margin: 0 0 0 0; |
| } |
| .RadMenu_MyCustomSkin_rtl .rmSlide |
| { |
| margin: 0 0 0 0; |
| } |
| .RadMenu_MyCustomSkin_rtl .rmFirst .rmSlide |
| { |
| margin-left: 1px; |
| } |
| .RadMenu_MyCustomSkin_rtl .rmVertical .rmSlide, |
| .RadMenu_MyCustomSkin_rtl .rmSlide .rmSlide, |
| .RadMenu_MyCustomSkin_Context_rtl .rmGroup .rmSlide |
| { |
| margin: 0 0 0 5px; |
| } |
| /* </Submenu offsets> */ |
| /* <Scrolling arrows> */ |
| .RadMenu_MyCustomSkin .rmLeftArrow, |
| .RadMenu_MyCustomSkin .rmRightArrow |
| { |
| background-color: #E6E6E6; |
| } |
| .RadMenu_MyCustomSkin .rmLeftArrow { background-position: -8px -312px; border-right: 1px solid #828282; } |
| .RadMenu_MyCustomSkin .rmRightArrow { background-position: -482px -216px; border-left: 1px solid #828282; } |
| .RadMenu_MyCustomSkin .rmTopArrow, |
| .RadMenu_MyCustomSkin .rmBottomArrow, |
| .RadMenu_MyCustomSkin .rmGroup .rmLeftArrow, |
| .RadMenu_MyCustomSkin .rmGroup .rmRightArrow |
| { |
| background-color: #E6E6E6; |
| } |
| .RadMenu_MyCustomSkin .rmTopArrow { background-position: 50% -367px; border-bottom: 1px solid #828282; } |
| .RadMenu_MyCustomSkin .rmBottomArrow { background-position: 50% -391px; border-top: 1px solid #828282; } |
| /* </Scrolling arrows> */ |
| /* <Separators> */ |
| .RadMenu_MyCustomSkin .rmHorizontal .rmSeparator .rmText, |
| .RadMenu_MyCustomSkin .rmVertical .rmHorizontal .rmSeparator .rmText |
| { |
| height: 22px; |
| margin: 1px 0 0; |
| width: 1px; |
| background-color: #A8A8A8; |
| } |
| .RadMenu_MyCustomSkin_Context .rmSeparator .rmText, |
| .RadMenu_MyCustomSkin .rmHorizontal .rmGroup .rmSeparator .rmText, |
| .RadMenu_MyCustomSkin .rmVertical .rmHorizontal .rmGroup .rmSeparator .rmText |
| { |
| background-color: transparent; |
| background-position: 0 -406px; |
| } |
| /* </Separators> */ |
| /* </RadMenu / Default> */ |
| <telerik:RadMenu ID="RadMenu1" runat="server" DataNavigateUrlField="Url" DataSourceID="XmlDataSource1" |
| DataTextField="Text" DataValueField="Text" EnableEmbeddedSkins="false" Flow="Vertical" |
| Skin="MyCustomSkin" Width="183"> |
| <DefaultGroupSettings ExpandDirection="Right" Width="183" /> |
| </telerik:RadMenu> |
I have a Telerik Grid with paging.
I want to Select All the rows in the Radgrid from a checkbox given in Header template of the grid from Client Side function
I am attaching my aspx code for your reference ,along will I am also attaching the javascript code that I am using currently.
But this code Selects all the rows of the same page and I want to select all the rows across all the pages in the grid by
Checking the Checkbox given in Header Template.
HI , <telerik:RadGrid ID="grdSearchResults" runat="server" AllowSorting="True" GridLines="None" Skin="Windows7" AutoGenerateColumns="False" PageSize="5" OnItemDataBound="grdSearchResults_ItemDataBound" OnNeedDataSource="grdSearchResults_NeedDataSource" CellSpacing="0"> <ClientSettings EnableRowHoverStyle="true"> </ClientSettings> <MasterTableView Width="100%" TableLayout="Auto" CommandItemDisplay="Top" AllowPaging="true" AllowSorting="true" PageSize="10" DataKeyNames="BackImage,Image,CreditImage"> <%--StatementID,StatementDate,AccountNumber,Rows,Columns,--%> <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="true" ShowExportToExcelButton="true" ShowExportToPdfButton="true" ShowExportToWordButton="true" ShowExportToCsvButton="true"> </CommandItemSettings> <RowIndicatorColumn> <HeaderStyle Width="20px"></HeaderStyle> </RowIndicatorColumn> <ExpandCollapseColumn> <HeaderStyle Width="20px"></HeaderStyle> </ExpandCollapseColumn> <Columns> <telerik:GridTemplateColumn HeaderText="Statement Date" DataField="StatementDate" UniqueName="StatementDate" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" SortExpression="statementdate"> <ItemTemplate> <asp:Label ID="lblstmtDate" runat="server" Text="<%# Bind('StatementDate') %>" Font-Bold="False"></asp:Label> </ItemTemplate> <HeaderStyle HorizontalAlign="Center"></HeaderStyle> <ItemStyle HorizontalAlign="Center"></ItemStyle> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderText="Account Number" DataField="AccountNumber" UniqueName="AccountNumber" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" SortExpression="AccountNumber"> <ItemTemplate> <asp:Label ID="lblAccountNumber" runat="server" Text="<%# Bind('AccountNumber') %>" Font-Bold="False"> </asp:Label> </ItemTemplate> <HeaderStyle HorizontalAlign="Center"></HeaderStyle> <ItemStyle HorizontalAlign="Center"></ItemStyle> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderText="Rows" DataField="Rows" UniqueName="Rows" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" SortExpression="Rows"> <ItemTemplate> <telerik:RadNumericTextBox ID="txtRows" runat="server" Width="20px" Type="Number" MaxLength="1" DbValue="<%# Bind('Rows') %>" ToolTip="Please enter number greater than 0"> <NumberFormat DecimalDigits="0" GroupSeparator="" /> </telerik:RadNumericTextBox> <asp:Label ID="Label2" runat="server" ForeColor="#FF3300" Text="*"></asp:Label> </ItemTemplate> <HeaderStyle HorizontalAlign="Center"></HeaderStyle> <ItemStyle HorizontalAlign="Center"></ItemStyle> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderText="Columns" DataField="Columns" UniqueName="Columns" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" SortExpression="Columns"> <ItemTemplate> <telerik:RadNumericTextBox ID="txtColumns" runat="server" Width="20px" Type="Number" MaxLength="1" DbValue="<%# Bind('Columns') %>" ToolTip="Please enter number greater than 0"> <NumberFormat DecimalDigits="0" GroupSeparator="" /> </telerik:RadNumericTextBox> <asp:Label ID="Label1" runat="server" ForeColor="#FF3300" Text="*"></asp:Label> </ItemTemplate> <HeaderStyle HorizontalAlign="Center"></HeaderStyle> <ItemStyle HorizontalAlign="Center"></ItemStyle> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn Visible="true" HeaderText="Add Credit Images" UniqueName="Credits" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"> <ItemTemplate> <asp:CheckBox ID="chkCredits" runat="server" /> </ItemTemplate> <HeaderStyle HorizontalAlign="Center"></HeaderStyle> <ItemStyle HorizontalAlign="Center"></ItemStyle> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderText="Add Back Images" UniqueName="BackImage" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"> <ItemTemplate> <asp:CheckBox ID="chkBackImages" runat="server" /> </ItemTemplate> <FooterStyle Width="100%" /> <HeaderStyle HorizontalAlign="Center"></HeaderStyle> <ItemStyle HorizontalAlign="Center"></ItemStyle> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn DataField="StatementID" HeaderText="StatementID" UniqueName="StatementID" Visible="false"> <ItemTemplate> <asp:Label ID="lblStatementID" runat="server" Text="<%# Bind('StatementID') %>"></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn DataField="DatePrinted" HeaderText="Date Printed" UniqueName="DatePrinted" Visible="false"> <ItemTemplate> <asp:Label ID="lblDatePrited" runat="server" Text="<%# Bind('DatePrinted') %>"></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn DataField="DateEmailed" HeaderText="Date Emailed" UniqueName="DateEmailed" Visible="false"> <ItemTemplate> <asp:Label ID="lblDateEmailed" runat="server" Text="<%# Bind('DateEmailed') %>"></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn DataField="Images" HeaderText="Images" UniqueName="Images" Visible="false"> <ItemTemplate> <asp:Label ID="lblImages" runat="server" Text="<%# Bind('Images') %>"></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderText="Add Images" UniqueName="AddImages" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"> <ItemTemplate> <asp:CheckBox ID="chkAddImages" Checked="true" runat="server" /> </ItemTemplate> <HeaderStyle HorizontalAlign="Center"></HeaderStyle> <ItemStyle HorizontalAlign="Center"></ItemStyle> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn DataField="IsSelected" HeaderText="IsSelected" UniqueName="IsSelected" Display="false"> <ItemTemplate> <asp:Label ID="lblIsSelected" runat="server" Text="<%# Bind('IsSelected') %>"></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn UniqueName="checkboxcolumn" HeaderStyle-Width="7%" ItemStyle-Width="7%" HeaderStyle-HorizontalAlign="Center"> <HeaderTemplate> <asp:CheckBox ID="CheckBoxAll" runat="server" onclick="javascript:selectAll(this);" /> </HeaderTemplate> <ItemTemplate> <asp:Image ID="SavedItemImage" runat="server" Visible="false" ImageUrl="~/Images/Common/disk2.gif" /> <asp:CheckBox ID="chkSelect" runat="server" /> </ItemTemplate> <HeaderStyle HorizontalAlign="Center" Width="30px"></HeaderStyle> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn DataField="StatementFileIndexId" FilterControlAltText="Filter StatementFileIndexId column" HeaderText="StatementFileIndexId" UniqueName="StatementFileIndexId" Visible="False"> <ItemTemplate> <asp:Label ID="lblStatementFileIndexId" runat="server" Text="<%# Bind('StatementFileIndexId') %>"></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> </Columns> <EditFormSettings> <EditColumn FilterControlAltText="Filter EditCommandColumn column"> </EditColumn> </EditFormSettings> <PagerStyle AlwaysVisible="True"></PagerStyle> </MasterTableView> <FilterMenu EnableImageSprites="False"> </FilterMenu> <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Windows7"> </HeaderContextMenu> </telerik:RadGrid> protected void imgBtnExportCSV_Click(object sender, EventArgs e){ foreach (GridDataItem item in grdLeadList.MasterTableView.Items) //loop through each grid item { if (item.Selected) { selectedItems.Add(item.ItemIndex); } } grdLeadList.ExportSettings.ExportOnlyData = true; grdLeadList.ExportSettings.OpenInNewWindow = true; grdLeadList.MasterTableView.Columns.FindByUniqueName("ClientSelectColumn").Visible = false; grdLeadList.MasterTableView.Columns.FindByUniqueName("EditCommandColumn1").Visible = false; grdLeadList.MasterTableView.Columns.FindByUniqueName("CompanyName").ItemStyle.CssClass = "excelHeaderStyle"; grdLeadList.ExportSettings.FileName = "ColderLeads"; grdLeadList.MasterTableView.ExportToCSV(); }
<%@ Page Language="C#" EnableViewState="False" AutoEventWireup="True" CodeBehind="CustomLocalSettings.aspx.cs" Inherits="CableSolve.Web.Dashboard.Dialog.Windows.CustomLocalSettings" %><%@ Import Namespace="CableSolve.Web.Controllers.Managers" %><!DOCTYPE html><html lang="en"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" Runat="Server" /> <telerik:RadFormDecorator ID="RadFormDecorator1" Runat="Server" DecoratedControls="All" /> <telerik:RadScriptBlock ID="RadScriptBlock1" Runat="Server" > <link rel="stylesheet" type="text/css" href="../../../Content/Dashboard/CustomLocalSettings.css?v=<%= VersionManager.GetApplicationVersion() %>" /> </telerik:RadScriptBlock> <telerik:RadScriptManager ID="RadScriptManager1" Runat="Server" EnablePageMethods="True"> <CompositeScript> <Scripts> <asp:ScriptReference Path="~/Scripts/Dashboard/CustomLocalSettings.js" /> <asp:ScriptReference Path="~/Scripts/Dashboard/SharedSettingsFunctionality.js" /> <asp:ScriptReference Path="~/Scripts/jquery-1.6.4.js" /> </Scripts> </CompositeScript> </telerik:RadScriptManager> <telerik:RadCodeBlock ID="RadCodeBlock1" Runat="server"> <script type="text/javascript"> var autoRefreshNumericTextBoxID = "<%= AutoRefreshNumericTextBox.ClientID %>"; var chartComboBoxID = "<%= ChartComboBox.ClientID %>"; var autoRefreshCheckBoxID = "<%= AutoRefreshCheckBox.ClientID %>"; </script> </telerik:RadCodeBlock> <div id="Content"> <fieldset id="RefreshProperties"> <legend>Refresh Settings</legend> <div id="RefreshArea"> <div id="RefreshLeftSide"> Auto-Refresh Enabled: <asp:CheckBox ID="AutoRefreshCheckBox" Runat="Server" /> </div> <div id="RefreshRightSide"> <telerik:RadNumericTextBox ID="AutoRefreshNumericTextBox" Runat="Server" Label="Auto-Refresh Interval (Minutes):" MaxValue="60" MinValue="1" ShowSpinButtons="True" Value="1" Width="225px" DataType="System.Int32"> <NumberFormat DecimalDigits="0" AllowRounding="False" /> </telerik:RadNumericTextBox> </div> </div> </fieldset> <fieldset id="ChartProperties"> <legend>Chart Properties</legend> <div id="ChartArea"> <telerik:RadComboBox ID="ChartComboBox" Runat="Server"> <Items> <telerik:RadComboBoxItem Runat="Server" Text="Bar Chart" Value="BarChart" /> <telerik:RadComboBoxItem Runat="Server" Text="Stacked Bar Chart" Value="StackedBarChart" /> </Items> </telerik:RadComboBox> </div> </fieldset> <div class="BottomButton"> <asp:UpdatePanel> <ContentTemplate> <telerik:RadButton ID="ApplySettings" Runat="Server" Text="Apply" OnClientClicked="CloseAndSave" /> </ContentTemplate> </asp:UpdatePanel> </div> </div> </form> </body></html>//SharedSettingsFunctionality.js//Contains functionality that all the dialog windows share in common. I found that I was maintaing a lot of code in multiple places unnecessarily.function GetRadWindow() { var oWindow = null; if (window.radWindow) oWindow = window.radWindow; else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; return oWindow;}function OnGetDockAttributesFailure(errors) { alert(errors);}function SetAutoRefreshState() { var autoRefreshNumericTextBox = $find(window.autoRefreshNumericTextBoxID); var wrapperElement = $get(autoRefreshNumericTextBox._wrapperElementID); var label = $(wrapperElement.getElementsByTagName("label")[0]); if ($('#' + window.autoRefreshCheckBoxID).is(':checked')) { autoRefreshNumericTextBox.enable(); label.addClass("LabelEnabled"); label.removeClass("LabelDisabled"); } else { autoRefreshNumericTextBox.disable(); label.addClass("LabelDisabled"); label.removeClass("LabelEnabled"); }}//CustomLocalSettings.jsfunction pageLoad() { var oWindow = GetRadWindow(); var dockID = oWindow.argument; if (dockID) { InitializeForm(dockID); } oWindow.argument = null;}function InitializeForm(dockID) { SetAutoRefreshState(); $('#' + window.autoRefreshCheckBoxID).click(SetAutoRefreshState); window.PageMethods.GetDockAttributes(dockID, OnGetDockAttributesSuccess, OnGetDockAttributesFailure);}//Pass the dialog data back to Dashboard.function CloseAndSave() { var oWindow = GetRadWindow(); var customAttributes = {}; customAttributes["RefreshEnabled"] = $('#' + window.autoRefreshCheckBoxID).is(':checked'); customAttributes["RefreshInterval"] = $find(window.autoRefreshNumericTextBoxID).get_value(); customAttributes["ChartType"] = $find(window.chartComboBoxID).get_value(); oWindow.argument = customAttributes; oWindow.close(); oWindow.argument = null; //Important because pageLoad gets called once more after oWindow closes.}function OnGetDockAttributesSuccess(result) { var dockData = $.parseJSON(result); //Change the initial loading state based on the dock's known settings. if (dockData["RefreshEnabled"]) { $('#' + window.autoRefreshCheckBoxID).attr('checked', true); var autoRefreshNumericTextBox = $find(window.autoRefreshNumericTextBoxID); autoRefreshNumericTextBox.set_value(dockData["RefreshInterval"]); autoRefreshNumericTextBox.enable(); var wrapperElement = $get(autoRefreshNumericTextBox._wrapperElementID); var label = $(wrapperElement.getElementsByTagName("label")[0]); label.addClass("LabelEnabled"); label.removeClass("LabelDisabled"); } $find(window.chartComboBoxID).findItemByValue(dockData["ChartType"]).select(); $('#Content').show(); GetRadWindow().autoSize();}//CustomLocalSettings CSSbody{ font-size: 12px; font-family: "segoe ui", arial, sans-serif; overflow: hidden; /*Leave this for auto-sizing behavior under IE*/ width: 403px;}.LabelEnabled,.riTextBox{ color: Black !important;}.LabelDisabled{ color: Gray !important;}.BottomButton{ padding-top: 7px; margin-left: 170px; padding-bottom: 7px;}#RefreshArea{ padding: 2px;}/*Leave this for IE8: Extends the fieldset to make it look proper.*/#ChartArea{ width: 378px;}#RefreshLeftSide{ float: left; margin-top: 3px;}#RefreshRightSide{ float: left; margin-left: 5px;}.rfdRoundedWrapper_fieldset{ display: block\9 !important;}#RefreshArea,#ChartArea{ overflow: auto\9; margin: 4px 5px 8px 5px\9;}._Telerik_IE9 #RefreshArea,._Telerik_IE9 #ChartArea{ margin: 0px;}#Content{ display: none;}