We have several pages where we have successfully exported RadGrid contents to Excel using the ExportToExcel() method. However, we now have a situation where we have a multi-page wizard using a MultiView controls and one of the View controls has a RadGrid on it with a preview of some results. The users would like to be able to export this RadGrid to Excel. However, the typical code does not work:
protected void ExportToExcelButton_Click(object sender, EventArgs e)
{
PreviewGrid.ExportSettings.IgnorePaging = true;
PreviewGrid.ExportSettings.OpenInNewWindow = true;
PreviewGrid.MasterTableView.ExportToExcel();
}
The RadGrid is fairly simple:
<telerik:RadGrid ID="PreviewGrid" AutoGenerateColumns="False"
OnNeedDataSource="PreviewGrid_NeedDataSource"
runat="server" Width="730px" Height="362px">
<ClientSettings>
<Selecting EnableDragToSelectRows="false"/>
<Scrolling AllowScroll="true" UseStaticHeaders="True"></Scrolling>
</ClientSettings>
<MasterTableView DataKeyNames="Key" NoMasterRecordsText="Nothing would be generated." CommandItemDisplay="Top" >
<CommandItemTemplate>
<div class="floatRightDiv" style="margin-top: 3px;margin-left: 700px;display:none;">
<asp:Button ID="ExportToExcelButton" runat="server" CssClass="rgExpXLS" OnClick="ExportToExcelButton_Click" Visible="false"/>
</div>
</CommandItemTemplate>
<Columns>
<telerik:GridBoundColumn UniqueName="Field1" DataField="Field1" HeaderText="Field1"></telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="Field2" DataField="Field2" HeaderText="Field2"></telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="Field3" DataField="Field3" HeaderText="Field3"></telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="Field4" DataField="Field4" HeaderText="Field4"></telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="Field5" DataField="Field5" HeaderText="Field5"></telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="Amount" DataField="Amount" HeaderText="Amount" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right"></telerik:GridBoundColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
How can we export from a grid in a window?
hi,
im using control rahhtml chart telerik in my project this is my code
SqlConnection con = new SqlConnection(@"Data Source=.;Initial Catalog=DB_WEB_Q_TEL;Integrated Security=True");
string req = "select time_tag,[ain_sebou|Niveau] as AIN_SEBOU_NIVEAU from QTSW_DATA1 where time_tag between ('01/01/2015') AND ('10/01/2015')";
DataSet DS = new DataSet();
con.Open();
if (DS.Tables.Contains("TRChart"))
{
DS.Tables.Remove("TRChart");
}
SqlDataAdapter da = new SqlDataAdapter(req, con);
da.Fill(DS, "TRChart");
con.Close();
RadHtmlChart chart = new RadHtmlChart();
chart.DataSource = DS.Tables["TRChart"];
chart.DataBind();
LineSeries LS = new LineSeries();
LS.DataFieldY = "AIN_SEBOU_NIVEAU";
LS.TooltipsAppearance.DataFormatString = "{0} at {1}";
chart.PlotArea.XAxis.LabelsAppearance.DataFormatString = "{0:dd-MM-yyyy HH:mm}";
chart.PlotArea.XAxis.LabelsAppearance.RotationAngle = 90;
chart.PlotArea.XAxis.BaseUnit = Telerik.Web.UI.HtmlChart.DateTimeBaseUnit.Days;
chart.PlotArea.XAxis.DataLabelsField = "time_tag";
chart.PlotArea.Series.Add(LS);
PlaceHolder3.Controls.Add(chart);
<asp:PlaceHolder ID="PlaceHolder3" runat="server">
</asp:PlaceHolder>
i want to display for example ( 230 at 01/01/2015 00:00 )
plzz i need help
I'm having issues with the rad editor buttons overlapping at smaller window sizes. In attached image, look at the buttons to the right of the "Aa" button. Code is below.
<telerik:RadEditor ID="rtbBannerHtml" runat="server"
Skin="Silk"
ToolbarMode="Default"
Height="300px"
Width="100%"
ToolsFile="/ets/radcontrols/Editor/config/AdvancedBaseTools.xml"
ShowSubmitCancelButtons="false">
</telerik:RadEditor>
We have recently upgraded the telerik controls from v2010.2.1029.35 to v2014.3.1209.35. With old version, when we paste the HTML content shown below in the 'HTML' mode and then switch to the 'Design' mode, the editor removes the duplicate 'HEAD', 'TITLE', 'BODY' tags automatically. But when the same thing is done with the upgraded one, the editor removes all the content with the duplicate tags except the last one.
Any suggestion why it is behaving differently? Thanks in advance for the suggestions.
=====================================================
<html><head><body topmargin=0 leftmargin=0> <html><head></head><body topmargin="0" leftmargin="0" style="height: 291px; color: black; font-family: times new roman; font-size: 12pt; background-color: white;" jquery111105915575585243771="3"><p><title></title><span style="color: rgb(0, 0, 0);">desc12333</span></p><p><span style="color: rgb(0, 0, 0);">asasa</span></p><p><span style="color: black;"><DIV style="PAGE-BREAK-INSIDE: avoid"><html><head><body topmargin=0 leftmargin=0> <html>
<head>
<title></title>
</head>
<body style="font-family: times new roman; font-size: 12pt;" leftmargin="0" topmargin="0">
<span style="color: #000000;">220 220</span> <br />
-----------<br />
<br />
</body>
</html>
</body></head></html></span></p><p><span style="color: rgb(0, 0, 0);"> </span></p></body></html></body></head></html>
============================================================

hi,
i want to replace name of serie from the 1st to the 2ed palce cheek the pic to understading
plz help me
We recently upgraded to the lates version of Telerik Ajax Controls (from 2010 Q2), and have an issue with the ComboBox.
We are dynaimcally loading user controls that contains comboboxes with autopostback set to true.
The problem is that the comboboxes selected values are lost on postback.
This works well when we use the old dll (2010 Q2).
I have tried the dll from Q3 2011 and i have the same problem with that.
Do you have any idea what would cause this?
Regards, Richard
Here is the code for the aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Modules_DEV_ComboboxBug_Default" %><%@ Register src="WebUserControl.ascx" tagname="WebUserControl" tagprefix="uc" %><!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"> <telerik:RadScriptManager runat="server" ID="rsm"></telerik:RadScriptManager> <div> <asp:PlaceHolder runat="server" ID="phContent" /> </div> </form></body></html>aspx.cs:
using System;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using Telerik.Web.UI;public partial class Modules_DEV_ComboboxBug_Default : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { WebUserControl uc = (WebUserControl)Page.LoadControl("WebUserControl.ascx"); uc.ID = "WebUserControl"; phContent.Controls.Add(uc); }}ascx:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="WebUserControl" %><telerik:radComboBox runat="server" ID="RadComboBox1" AutoPostBack="true"></telerik:radComboBox><telerik:radComboBox runat="server" ID="RadComboBox2" AutoPostBack="true"></telerik:radComboBox>ascx.cs:
using System;using System.Collections;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;public partial class WebUserControl : System.Web.UI.UserControl{ protected void Page_Load(object sender, EventArgs e) { string[] dataSource = new string[] {"UnSelected", "First", "Second", "Third" }; RadComboBox1.DataSource = dataSource; RadComboBox1.DataBind(); RadComboBox2.DataSource = dataSource; RadComboBox2.DataBind(); }}I have my Radgrid defined with the master table in Batch mode as follows:
<telerik:RadGrid ID="EventSubjects" CssClass="eventSubjectsGrid" ShowStatusBar="true" AutoGenerateColumns="False" GridLines="Both" AllowPaging="True" PagerStyle-AlwaysVisible="true" OnNeedDataSource="EventSubjects_NeedDataSource" OnBatchEditCommand="EventSubjects_BatchEditCommand" Skin="Sunset" runat="server" GroupPanelPosition="Top"> <ClientSettings AllowKeyboardNavigation="true"> <Selecting AllowRowSelect="True" /> <ClientEvents OnCommand="gridCommand" /> </ClientSettings> <ValidationSettings EnableValidation ="true" CommandsToValidate="PerformInsert,Update,UpdateEdited,saveChanges,BatchEdit"></ValidationSettings> <MasterTableView EditMode="Batch" CommandItemDisplay="Bottom" DataKeyNames="PhotoSubjectID,EventPhotoSubjectID,EventPhotoSessionID"> <BatchEditingSettings EditType="Cell" />In the ClientEvents OnCommand js function I am trying to the the Data Key for the current DataGridItem, but it comes back null (rowPhotoSessionID . When I check the masterTableView, masterTable.get_clientDataKeyNames(), it returns an empty array.
function gridCommand(sender, args) { if (args.get_commandName() == "BatchEdit") { var masterTable = sender.get_masterTableView(); var batchManager = sender.get_batchEditingManager(); var dataItems = masterTable.get_dataItems(); var validationFails = false; for (var i = 0; i < dataItems.length; i++) { var barcodeCell = dataItems[i].get_cell("Barcode"); var barcodeValue = batchManager.getCellValue(barcodeCell); var rowPhotoSessionID = dataItems[i].getDataKeyValue("PhotoSubjectID");..How do I get the DataKeys for the current DataGridRow in this situation?
In case you are wondering, I am trying to do validation when the user clicks the 'Save Changes' button in BatchEdit mode, by passing the barcodes on the page to the server in an ajax call, and then update the cells that are invalid. So, I need both the barcode value and the PhotoSubjectID so that I can tell which barcodes changed.
I looked all over to find a property or method that would return me JUST the edited data values, I found this forum entry Batch Editing - Need to have the save changes button outside the grid , that said that this internal collection has the edited data, but did not recommend using it.
$find('RadGrid1').get_batchEditingManager()._changesIs there some other way, in BatchEdit mode to get the edited values on the Client side so that I can do validation?

I have the need to either, create my own GrandTotal column to the right of the grid or .. allow me to show a PivotGridRowField to the right of the report.
Here are my fields (that are displayed as columns):
PivotGridColumnFIeld: Period
PivotGridAggregateFields: Plan, Actual
I want to add a column that is a percentage of Actual / Plan but I only want this column to show at the end in the GrandTotals section? Is there any way to do this?
Also, is there anyway to display PivotGridRowFields to the right of the GrandTotal columns?
Thanks,

Hello,
I'm using a RadAjaxManager to perform an async request to the code behind. With Chrome, the page jumps to the top and then returns to the original scroll location. I'm kicking off the request via the change event of a Kendo UI DatePicker. The event calls the ajaxRequestWithTarget js function from the RadAjaxManager. Sometimes is takes 1 or 2 calendar date changes for this behavior to start. This behavior only happens with Chrome (42.0.2311.90 m). Below is an example.
Browser: Chrome (42.0.2311.90 m)
Dev Environment: Visual Studio 2013
Telerik Version: UI for ASP.NET AJAX Q1 2015
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="RadAjaxManagerIssue.Test" %><br><!DOCTYPE html><br><br><html xmlns="http://www.w3.org/1999/xhtml"><br> <br><head runat="server"><br> <title></title><br> <script src="//code.jquery.com/jquery-1.9.1.min.js"></script><br> <script src="http://cdn.kendostatic.com/2015.1.318/js/kendo.ui.core.min.js"></script><br> <link href="http://cdn.kendostatic.com/2015.1.318/styles/kendo.common.min.css" rel="stylesheet" type="text/css" /><br> <link href="http://cdn.kendostatic.com/2015.1.318/styles/kendo.default.min.css" rel="stylesheet" type="text/css"/><br></head><br><br><body> <br> <form id="form1" runat="server"><br> <br> <div><br> <telerik:RadScriptManager ID="rsm" runat="server"> </telerik:RadScriptManager><br> <br> <div style="padding-top: 1500px;"><br> <input id="txtMonth" runat="server" /><br> <asp:CustomValidator ID="valMonthPicker" ControlToValidate="txtMonth" ClientValidationFunction="IsValidDate" Text="*" runat="server"><br> </asp:CustomValidator><br> <input id="txtUpdatedControl" runat="server" /> <br> </div><br> </div><br> <br> <telerik:RadAjaxManager ID="ram" runat="server"><br> <AjaxSettings><br> <telerik:AjaxSetting AjaxControlID="txtMonth"><br> <UpdatedControls><br> <telerik:AjaxUpdatedControl ControlID="txtUpdatedControl" /><br> </UpdatedControls><br> </telerik:AjaxSetting><br> </AjaxSettings><br> </telerik:RadAjaxManager><br> <br> <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"><br> <script type="text/javascript"> <br> function InitiateAsyncRequest() {<br> $find('ram').ajaxRequestWithTarget('txtMonth', '');<br> return false;<br> }<br><br> function IsValidDate(source, args) {<br> var datePicker = $('#txtMonth').data('kendoDatePicker');<br> var date = datePicker.value();<br> var format = datePicker.format;<br> args.IsValid = kendo.parseDate(date, format);<br> }<br><br> $('#txtMonth').kendoDatePicker({<br> start: 'year',<br> depth: 'year',<br> format: 'MM/yyyy',<br> change: InitiateAsyncRequest<br> });<br> </script><br> </telerik:RadCodeBlock><br> </form><br></body><br></html>