or
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;}EnableRandomOrder="true" and
PauseOnMouseOver
="false"
as below. In the attached image below, Next Item to be shown is Disease Analytics when i click on the ControlButtons in right side. How can i access the index/ item itself on click of the control button in javacript. I need the next item/previous item to be shown when i click on the controlbuttons in javascript only as I've to update the description of the selected item using ajaxmanager and also on random click on the radrotator item(which is an image) corresponding description has to be shown.
<ControlButtons OnClientButtonClick="OnClientButtonClick" />
function OnClientButtonClick(sender, args) { var objArgs; debugger; if (typeof sender._nextItemIndex === "undefined") objArgs = 0; else { if (sender._nextItemIndex == null) objArgs = 0; else objArgs = sender._nextItemIndex; } //sender.get_currentItem().get_index(); $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest(objArgs);}<telerik:RadAjaxManager ID="RadAjaxManager1" OnAjaxRequest="RadAjaxManager1_AjaxRequest" runat="server" DefaultLoadingPanelID="LoadingPanel1"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="chkRotationType"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="radRotProducts" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="RadAjaxManager1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="detailsPanel" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager><telerik:RadAjaxPanel ID="AjaxPanel1" CssClass="rotNoButtonsBack" runat="server" LoadingPanelID="LoadingPanel1"> <div class="mainDiv"> <div class="rotatorBackground"> <%-- ItemWidth and ItemHeight include 2x5(pixels) margin and 1x2(pixels) border --%> <telerik:RadRotator ID="radRotProducts" RotatorType="CarouselButtons" runat="server" EnableRandomOrder="true" PauseOnMouseOver="false" OnClientItemClicked="OnClientItemClicked" Width="800px" Height="400px" CssClass="rotatorCarouselStyle" ItemHeight="200" FrameDuration="2000" ItemWidth="300" ScrollDuration="500"> <ItemTemplate> <asp:Image runat="server" ID="imgProduct" ImageUrl='<%#DataBinder.Eval(Container.DataItem,"Image")%>' CssClass="RotatorItem" /> </ItemTemplate> <ControlButtons OnClientButtonClick="OnClientButtonClick" /> </telerik:RadRotator> </div> </div> </telerik:RadAjaxPanel>