Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
746 views
Hi Telerik Team,

I want to Export the Rad Grid data to the Excel Sheet, I have added a link button to the Rad Grid dynamically. For Exporting the Rad Grid data to the Excel Sheet i have placed the rad grid inside a "RadAjaxPanel", When i place the Rad grid Inside the RadAjaxPanel the entire data is being Exported to the Excel sheet, but the link button that i have added dynamically to the Rad grid is not doing any post back (My requirement is on clicking this link button it will get the DataKey and based on the DataKey value it will fetch the Records from the Database and display in the RadGrid in a POP-up), but when I remove the Rad Grid from the RadAjaxPanel the data is not being Exporting to the Excel Sheet it is giving the Following Error:

"Server Error in '/' Application.

Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation."

In this Case the Link Button that i have added dynamically is doing the Post back and displaying the Data in the Pop-up.
This is the Code that i am use for Rad Grid for opening pop-up on Link button Click:

"<telerik:RadGrid ID="rgAccountDetails" runat="server" AllowPaging="True" PageSize="10" AllowFilteringByColumn="True" AllowSorting="True"  Visible="false"
                Skin="Vista" OnPreRender="rgAccountDetails_PreRender" OnColumnCreated="rgAccountDetails_ColumnCreated" OnGridExporting="rgAccountDetails_GridExporting"
                OnItemCommand="rgAccountDetails_ItemCommand" OnPageIndexChanged="rgAccountDetails_PageChanged"
                OnExcelMLExportRowCreated="rgAccountDetails_ExcelMLExportRowCreated">
                <ExportSettings ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true">
                <Excel Format="ExcelML" />
                <Pdf FontType="Subset" PaperSize="Letter" PageWidth="18in" PageHeight="150in" />
            </ExportSettings>
                    <PagerStyle Mode="NextPrevAndNumeric" />
            <MasterTableView  DataKeyNames="AccountID" CommandItemDisplay="Top">
               <CommandItemSettings ShowExportToWordButton="true" ShowExportToExcelButton="true"
                ShowExportToCsvButton="true" ShowAddNewRecordButton="false" ShowExportToPdfButton="True" />
                <RowIndicatorColumn>
                    <HeaderStyle Width="20px" />
                </RowIndicatorColumn>
                <ExpandCollapseColumn>
                    <HeaderStyle Width="20px" />
                </ExpandCollapseColumn>
            </MasterTableView>
        </telerik:RadGrid>"

In the above code the link button is doing Post Back and fetching the data and display in the Pop-up, but Rad grid data is not exported to the Excel sheet.

"<telerik:RadAjaxPanel ID="RadAjaxPanel2" runat="server" LoadingPanelID="RadAjaxLoadingPanel2" 
        ClientEvents-OnRequestStart="requestStart" HorizontalAlign="NotSet">
        <telerik:RadGrid ID="rgInvoicedetails" runat="server" AllowPaging="True" 
                PageSize="7" AllowFilteringByColumn="True" AllowSorting="True"  Visible="False"
         Skin="Vista" OnItemCommand="rgInvoicedetails_ItemCommand" OnColumnCreated="rgInvoicedetails_ColumnCreated"
           OnPageIndexChanged="rgInvoicedetails_PageChanged" GridLines="None">
                 <PagerStyle Mode="NextPrevAndNumeric" />
                 <ExportSettings FileName="InvoiceReports" ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true">
                      <Excel Format="ExcelML" FileExtension="xlsx"  />
                <Pdf FontType="Subset" PaperSize="Letter" PageWidth="18in" PageHeight="150in" />
                 </ExportSettings>
            <MasterTableView DataKeyNames="InvoiceID">
                <CommandItemSettings ExportToPdfText="Export to Pdf" />
                <RowIndicatorColumn>
                    <HeaderStyle Width="20px" />
                </RowIndicatorColumn>
                <ExpandCollapseColumn>
                    <HeaderStyle Width="20px" />
                </ExpandCollapseColumn>
            </MasterTableView>
        </telerik:RadGrid>
        </telerik:RadAjaxPanel>"

In the above code the link button is not doing Post Back and is not able fetching the data and display in the Pop-up, but the Grid data is Exported to the Excel Sheet.



Please help me.

Thanks,
Arvind.
Shinu
Top achievements
Rank 2
 answered on 04 Nov 2010
3 answers
174 views
I know that you guys have been using sprites in skins for an age now, but I stumbled across the Sprite and Image Optimization FrameWork on CodePlex and wondered if anyone from telerik towers wanted to comment on its usability with controls like RadToobBar and RadTreeView where the developer may well be requesting a number of images for the control in question.

-- 
Stuart
Kamen Bundev
Telerik team
 answered on 04 Nov 2010
6 answers
319 views
Hi,
I am trying to use a simple appointment template, but I just cannot make it work. Version: 2010.1.413.35

 <telerik:RadScheduler runat="server" ID="RadScheduler1" SelectedView="WeekView" SelectedDate="2009-02-02"
  TimeZoneOffset="-05:00:00" FirstDayOfWeek="Sunday" LastDayOfWeek="Saturday"
  StartEditingInAdvancedForm="false" EnableDescriptionField="true"
  OnClientAppointmentCreated="appointmentCreated" Width="100%" Height="100%" OverflowBehavior="Scroll"
  ShowAllDayRow="false"
  ShowFullTime="true"
  ShowFooter="false"
  Skin="Office2007"
  style="outline:none;border:0px;top:0px;bottom:0px;position:absolute;"
  >
  <AdvancedForm Modal="true" />
  <TimelineView GroupBy="Calendar" GroupingDirection="Vertical" />
  <WebServiceSettings Path="../WebServices/Plan/Agenda.asmx" ResourcePopulationMode="ServerSide" />
 <TimeSlotContextMenuSettings EnableDefault="true" />
 <AppointmentContextMenuSettings EnableDefault="true" />            
 
 <AppointmentTemplate>
    <div>
     <h1><%# Eval("Subject") %></h1>
    </div>
 </AppointmentTemplate>
 
 </telerik:RadScheduler>

Thanks,

Teo
tasos
Top achievements
Rank 1
 answered on 04 Nov 2010
1 answer
161 views
Hello,

Can i change the special days tooltip style? (font/Backcolor/forcolor etc)

Regards,
Oren
Cori
Top achievements
Rank 2
 answered on 04 Nov 2010
1 answer
198 views
Hi all,
    I'm trying to create a usercontrol for file explorer using RadFileExplorer and RadWindow , but when i use the user control the RadFileExplorer not work fine. 
Below are the problem that i encounter.
   1. when the control load I need to pre the refresh button of the RadFileExplorer to display all the folder inside my ViewPaths
   2. The header of the list file on Firefox is to big that all space is been occufied
   3. The list file on the IE has a big space

here is the sample code that I made

<telerik:RadWindow runat="server" Width="550px" Height="500px" VisibleStatusbar="false" ShowContentDuringLoad="true" VisibleOnPageLoad="true" ID="WindowExplorer" Modal="true" Behaviors="Close,Move" Title="File Explorer">
    <ContentTemplate>
        <table width="100%" height="100%" cellspacing="0" cellpadding="0">
           <tr>
              <td align="center">
                  <telerik:RadFileExplorer runat="server" ID="Explorer" Width="530px" Height="440px">
                       <Configuration ViewPaths="~/Administration/controls" />
                   </telerik:RadFileExplorer>
              </td>
           </tr>
        </table>        
    </ContentTemplate>
</telerik:RadWindow>
Dobromir
Telerik team
 answered on 04 Nov 2010
3 answers
127 views
Hello All,

The following yellow line displays when I press tab key on Category drop down.
I am using a telerik RadAsynchronous upload for file uploading where this yellow line on tab focus is coming.


 <telerik:RadAsyncUpload ID="RadUploadDocument" runat="server" OnClientDeleting="ToDeleteFile" EnableEmbeddedSkins="false"
                        AllowedFileExtensions=".pdf,.doc,.xls,.ppt,.pdfx,.xlsx,.docx,.pptx" ControlObjectsVisibility="none"
                        InputSize="50" Font-Names="Arial" MaxFileSize="5242880" OnClientFileUploaded="OnValidationSucceed"
                        AutoAddFileInputs="true" OnClientValidationFailed="validationFailed" MaxFileInputsCount="1"
                        Style="position: relative; float: left; margin: 3px 0px 0px 10px; width: 385px;
                        ">
                    </telerik:RadAsyncUpload>  
Genady Sergeev
Telerik team
 answered on 04 Nov 2010
1 answer
246 views
I'm trying to use a custom color pallette with stacked bar charts and can't seem to get the legend colors to match the chart.  I can't find any other threads related to this issue.

Test.aspx:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="BorrowSmartReporting.test" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Panel ID="TestArea" runat="server" />
    </div>
    </form>
</body>
</html>


Test.aspx.cs

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Data;
using System.IO;
using System.Linq;
using System.Web;
using Telerik.Web.UI;
using Telerik.Charting;
  
namespace BorrowSmartReporting
{
    public partial class test : System.Web.UI.Page
    {
        public System.Drawing.Color[] ChartColors = new System.Drawing.Color[13]
        {
            System.Drawing.Color.Black,        //Total Liabilities
            System.Drawing.Color.DarkOrange,   //Spent
            System.Drawing.Color.YellowGreen,  //Saved
            System.Drawing.Color.LightBlue,
            System.Drawing.Color.BurlyWood,
            System.Drawing.Color.DarkKhaki,
            System.Drawing.Color.DarkSeaGreen,
            System.Drawing.Color.Goldenrod,
            System.Drawing.Color.LightSteelBlue,
            System.Drawing.Color.LightSalmon,
            System.Drawing.Color.Silver,
            System.Drawing.Color.Thistle,
            System.Drawing.Color.Gold
        };
  
  
        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable LiabilityTable = new DataTable();
            LiabilityTable.Columns.Add("Balance", System.Type.GetType("System.Double"));
            LiabilityTable.Columns.Add("LiabilityType", System.Type.GetType("System.String"));
  
            DataRow Test1 = LiabilityTable.NewRow();
            Test1["Balance"] = 21000;
            Test1["LiabilityType"] = "Auto";
            LiabilityTable.Rows.Add(Test1);
  
            DataRow Test2 = LiabilityTable.NewRow();
            Test2["Balance"] = 10000;
            Test2["LiabilityType"] = "Credit Card";
            LiabilityTable.Rows.Add(Test2);
  
            DataRow Test3 = LiabilityTable.NewRow();
            Test3["Balance"] = 210000;
            Test3["LiabilityType"] = "Mortgage";
            LiabilityTable.Rows.Add(Test3);
  
            DataView Liabilities = new DataView(LiabilityTable);
  
            RadChart CurrentLiabilitiesPageChart2 = new RadChart();
  
            double total = 0;
            for (int i = 0; i < Liabilities.Count; i++)
            {
                ChartSeries stackedBarSeries = new ChartSeries();
                stackedBarSeries.Type = ChartSeriesType.StackedBar;
  
                double balance = 0;
                double.TryParse(Liabilities[i]["Balance"].ToString(), out balance);
                total += balance;
                stackedBarSeries.AddItem(balance);
  
                stackedBarSeries.Name = Liabilities[i]["LiabilityType"].ToString() + " (" + balance.ToString("C0") + ")";
                stackedBarSeries.Items[0].Label.TextBlock.Visible = false;
                stackedBarSeries.Items[0].Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Gradient;
                stackedBarSeries.Items[0].Appearance.FillStyle.MainColor = ChartColors[i + 3];
  
                CurrentLiabilitiesPageChart2.Series.Add(stackedBarSeries);
            }
  
            CurrentLiabilitiesPageChart2.ChartTitle.TextBlock.Text = "Balances";
            CurrentLiabilitiesPageChart2.Width = 400;
            CurrentLiabilitiesPageChart2.Height = 300;
            CurrentLiabilitiesPageChart2.Appearance.Border.Visible = false;
            CurrentLiabilitiesPageChart2.PlotArea.Appearance.Border.Visible = false;
            CurrentLiabilitiesPageChart2.Legend.Appearance.Border.Visible = false;
            CurrentLiabilitiesPageChart2.PlotArea.XAxis.Appearance.TextAppearance.Visible = false;
            CurrentLiabilitiesPageChart2.Legend.Appearance.ItemMarkerAppearance.Figure = "Rectange";
            CurrentLiabilitiesPageChart2.PlotArea.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Solid;
            CurrentLiabilitiesPageChart2.PlotArea.Appearance.FillStyle.MainColor = Color.White;
  
            CurrentLiabilitiesPageChart2.PlotArea.XAxis.AxisLabel.TextBlock.Appearance.TextProperties.Color = Color.Black;
            CurrentLiabilitiesPageChart2.PlotArea.YAxis.Appearance.CustomFormat = "C0";
            CurrentLiabilitiesPageChart2.Legend.Appearance.Location = Telerik.Charting.Styles.LabelLocation.OutsidePlotArea;
            CurrentLiabilitiesPageChart2.AutoLayout = true;
  
            TestArea.Controls.Add(CurrentLiabilitiesPageChart2);
        }
    }
}

Enclosed is the resulting Chart.

Help?!

Thanks,

--Tad Richard

Evgenia
Telerik team
 answered on 04 Nov 2010
1 answer
86 views
Windows 7 x64, VS 2008, ASP.Net AJAX v 2010.2.826.35.

I have an issue with multiple combo boxes being shown on screen using the onFocus style. When I quickly tab through all the fields in IE sometimes the onFocus style isn't reset.
 
I am using a modified Windows 7 theme that with changed the onFocus background to blue and border colour to red of the Text and Combo boxes as shown in image. The top field is the Focused textbox with the cursor and as you can see there are 2 combos with normal style and 2 with Focused style.

I have tested using the standard Windows 7 theme and have exactly the same problem so don't think it is a style builder issue.

Is it an issue and on the fix list?

Thanks

B
Simon
Telerik team
 answered on 04 Nov 2010
1 answer
106 views
Hello,

I'm a first-time poster here, so please forgive me if I'm posting in the wrong place. I've implemented a page using google-type ahead like here:

http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandcombo/defaultcs.aspx?product=grid

Now, I'd like to be able to grab the column selected and it's value in the filter and pass that along to a 'button-click' event. I'm having trouble figuring out where and how to get these values. Can anybody help me?


Thanks,
Phil

Maria Ilieva
Telerik team
 answered on 04 Nov 2010
6 answers
403 views
I added the following code to page:
<telerik:RadButton
                            ID="RadButton1"
                            runat="server"
                            Text="RadButton Submit"
                            EnableEmbeddedSkins="false"
                            Skin="MyCustomSkin">
                        </telerik:RadButton>
And received the " Unknown server tag 'telerik:RadButton'." message. Also I can't find RadButton  among RadControls in Toolbox. What am I doing wrong?
Michael
Top achievements
Rank 1
 answered on 04 Nov 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?