Export to Excel Header Button

12 posts, 0 answers
  1. KawaUser
    KawaUser avatar
    57 posts
    Member since:
    Oct 2010

    Posted 14 Jul 2011 Link to this post

    After I have built the grid, I now want to initiate the export to excel. When I go into the grid properties and set the master table view's command item settings to show export to excel button = true and set the commanditemdisplay = top, the display on top of the grid shows up in the designer, but when I run the application it does not appear. What are some reasons this could be happening?

    Thanks,
    Chuck
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 15 Jul 2011 Link to this post

    Hello KawaUser,
    I cannot reproduce the issue locally and here is a sample code which worked as expected.
    aspx:
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="ExportOrientation.aspx.cs"
        Inherits="RadGrid_ExportOrientation" %>
     
    <%@ Register TagPrefix="telerik" Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" %>
    <!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:ScriptManager runat="server" ID="ScriptManager1" />
            <telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource">
                <ExportSettings OpenInNewWindow="true" />
                <MasterTableView CommandItemDisplay="Top">
                    <CommandItemSettings ShowExportToPdfButton="true" ShowExportToExcelButton="true"
                        ShowExportToWordButton="true" />
                </MasterTableView>
            </telerik:RadGrid>
        </div>
        </form>
    </body>
    </html>

    C#:
    protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
       {
           RadGrid1.DataSource = new string[] { "Test" };
       }

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. KawaUser
    KawaUser avatar
    57 posts
    Member since:
    Oct 2010

    Posted 15 Jul 2011 Link to this post

    Now, a day later the command display appears, but when i click on it nothing happens. The grid blinks and no excel sheet is produced.
    This is the asp.net behind the page. I am using AJAX does that make a difference?

    <asp:Panel ID="pnlNormalView" runat="server">
                                            <table class="table_100pct">
                                                <tr>
                                                    <td valign="bottom" width="50%">
                                                        <table>
                                                            <tr>
                                                                <td style="width: 30px; background-color: Green;">
                                                                </td>
                                                                <td>
                                                                    <asp:Label ID="Label309" runat="server" CssClass="formLabel" Text="- Indicates New Entry"
                                                                        ForeColor="Black"></asp:Label>
                                                                </td>
                                                                <td style="width: 30px;">
                                                                </td>
                                                                <td style="width: 30px; background-color: Red;">
                                                                      
                                                                </td>
                                                                <td>
                                                                    <asp:Label ID="Label310" runat="server" CssClass="formLabel" Text="- Indicates Changed Entry"
                                                                        ForeColor="Black"></asp:Label>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </td>
                                                    <td style="text-align: right;">
                                                          
                                                    </td>
                                                </tr>
                                            </table>
                                            <table>
                                                <tr>
                                                    <td>
                                                        <asp:Button ID="btnShowNormalViewWithRecords" runat="server" Text="Expand Rows With Records" /><asp:Button
                                                            ID="btnHideNormalViewRows" runat="server" Text="Collapse Rows" /><asp:Button ID="btnNormalviewShowFilters"
                                                                runat="server" Text="Show/Hide Column Filters" />
                                                        <asp:Button ID="btnExportCurrentLines" runat="server" Text="Export to Excel"
                                                            ToolTip="Click here to export to Excel." Visible="False" />
                                                    </td>
                                                </tr>
                                            </table>
                                            <%---------------------Current OPOSS----------------------%>
                                            <telerik:RadGrid ID="radGrdCurrentPOLines" runat="server" AllowPaging="true" AllowSorting="True"
                                                AutoGenerateColumns="False" Width="100%" OnItemCreated="radGrdCurrentPOLines_ItemCreated"
                                                OnItemCommand="radGrdCurrentPOLines_ItemCommand" GridLines="None" Skin="Web20"
                                                AllowFilteringByColumn="true" DataSourceID="dsCurrentOPOSSLines" PageSize="50">
                                                <GroupingSettings CaseSensitive="false" />
                                                <ClientSettings EnableRowHoverStyle="true">
                                                    <Selecting AllowRowSelect="true" />
                                                </ClientSettings>
                                                <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Web20">
                                                </HeaderContextMenu>
                                                <ExportSettings IgnorePaging="True" OpenInNewWindow="True">
                                                    <Excel FileExtension="xlsx" Format="ExcelML" />
                                                </ExportSettings>
                                                <MasterTableView Width="100%" CommandItemDisplay="Top">
                                                    <NestedViewTemplate>
                                                        <asp:Panel runat="server" ID="InnerContainer" BackColor="Cornsilk" Visible="true"
                                                            BorderColor="Red" BorderStyle="Solid" BorderWidth="1px" HorizontalAlign="Right">
                                                            <asp:Label ID="lblPOLineID" Font-Bold="true" Font-Italic="true" Text='<%# Eval("_POLineID") %>'
                                                                Visible="false" runat="server" /><div style="padding: 10px;">
                                                                    <fieldset style="padding: 10px; width: 75%">
                                                                        <legend style="padding: 10px;"><b>Inbound lines for PO Number
                                                                            <%#Eval("_PONumber")%>
                                                                            Line
                                                                            <%#Eval("_LineNumber")%></b></legend>
                                                                        <telerik:RadGrid runat="server" ID="POLineInbound" AllowSorting="true" AllowPaging="true"
                                                                            AutoGenerateColumns="false" Skin="Sunset" DataSourceID="dsInboundLines">
                                                                            <GroupingSettings CaseSensitive="false" />
                                                                            <ClientSettings EnableRowHoverStyle="true">
                                                                                <Selecting AllowRowSelect="true" />
                                                                            </ClientSettings>
                                                                            <MasterTableView DataKeyNames="_POLineID">
                                                                                <Columns>
                                                                                    <telerik:GridBoundColumn UniqueName="PackingSlip" DataField="_PackingSlip" HeaderText="Packing Slip"
                                                                                        SortExpression="_PackingSlip">
                                                                                    </telerik:GridBoundColumn>
                                                                                    <telerik:GridDateTimeColumn SortExpression="_ShipQuantity" HeaderText="Ship Quantity"
                                                                                        HeaderButtonType="TextButton" DataField="_ShipQuantity" UniqueName="ShipQuantity">
                                                                                    </telerik:GridDateTimeColumn>
                                                                                    <telerik:GridDateTimeColumn SortExpression="_POLineInboundCreateDate" HeaderText="Create Date"
                                                                                        DataFormatString="{0:M/dd/yyyy}" HeaderButtonType="TextButton" DataField="_POLineInboundCreateDate"
                                                                                        UniqueName="POLineInboundCreateDate">
                                                                                    </telerik:GridDateTimeColumn>
                                                                                </Columns>
                                                                            </MasterTableView></telerik:RadGrid></fieldset>
                                                                </div>
                                                        </asp:Panel>
                                                    </NestedViewTemplate>
                                                    <CommandItemSettings
                                                        ShowAddNewRecordButton="False" ShowExportToExcelButton="True"
                                                        ShowRefreshButton="False" />
                                                    <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                                                    </RowIndicatorColumn>
                                                    <ExpandCollapseColumn Visible="True">
                                                    </ExpandCollapseColumn>
                                                    <Columns>
                                                        <telerik:GridTemplateColumn HeaderText="PO #" SortExpression="_PONumber" DataField="_PONumber"
                                                            UniqueName="_PONumber">
                                                            <ItemTemplate>
                                                                <asp:Label Text='<%#Eval("_PONumber")%>' ID="lblPONumber" runat="server"></asp:Label></ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridBoundColumn AllowFiltering="false" DataField="_LineNumber" DataType="System.Int32"
                                                            HeaderText="Line" SortExpression="_LineNumber" UniqueName="_LineNumber" HeaderStyle-HorizontalAlign="Center"
                                                            ItemStyle-HorizontalAlign="Center">
                                                            <HeaderStyle HorizontalAlign="Center" />
                                                            <ItemStyle HorizontalAlign="Center" />
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="_PartNumber" HeaderText="Part" SortExpression="_PartNumber"
                                                            UniqueName="_PartNumber">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridTemplateColumn HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"
                                                            UniqueName="PartRevision" AllowFiltering="false" HeaderText="Drw Rev">
                                                            <ItemTemplate>
                                                                <asp:Label Text='<%#Eval("_PartRevision")%>' ID="lblPartRevision" runat="server"></asp:Label><asp:Label
                                                                    Text='<%#Eval("_PreviousPartRevision")%>' ID="lblPreviousPartRevision" runat="server"
                                                                    Visible="false"></asp:Label></ItemTemplate>
                                                            <HeaderStyle HorizontalAlign="Center" />
                                                            <ItemStyle HorizontalAlign="Center" />
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridBoundColumn DataField="_PartDescription" HeaderText="Description" SortExpression="_PartDescription"
                                                            UniqueName="_PartDescription">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridTemplateColumn HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"
                                                            SortExpression="_DueDate" UniqueName="DueDate" AllowFiltering="false" HeaderText="Due Date">
                                                            <ItemTemplate>
                                                                <asp:Label Text='<%#Eval("_DueDate")%>' ID="lblDueDate" runat="server"></asp:Label><asp:Label
                                                                    Text='<%#Eval("_PreviousDueDate")%>' ID="lblPreviousDueDate" runat="server" Visible="false"></asp:Label></ItemTemplate>
                                                            <HeaderStyle HorizontalAlign="Center" />
                                                            <ItemStyle HorizontalAlign="Center" />
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridTemplateColumn HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"
                                                            UniqueName="QuantityOrdered" AllowFiltering="false" HeaderText="Qty Ord">
                                                            <ItemTemplate>
                                                                <asp:Label Text='<%#Eval("_QuantityOrdered")%>' ID="lblQuantityOrdered" runat="server"></asp:Label><asp:Label
                                                                    Text='<%#Eval("_PreviousQuantityOrdered")%>' ID="lblPreviousQuantityOrdered"
                                                                    runat="server" Visible="false"></asp:Label></ItemTemplate>
                                                            <HeaderStyle HorizontalAlign="Center" Width="50px" />
                                                            <ItemStyle HorizontalAlign="Center" />
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridTemplateColumn HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"
                                                            UniqueName="QuantityReceived" AllowFiltering="false" HeaderText="Qty Rec">
                                                            <ItemTemplate>
                                                                <asp:Label Text='<%#Eval("_QuantityReceived")%>' ID="lblQuantityReceived" runat="server"></asp:Label><asp:Label
                                                                    Text='<%#Eval("_PreviousQuantityReceived")%>' ID="lblPreviousQuantityReceived"
                                                                    runat="server" Visible="false"></asp:Label></ItemTemplate>
                                                            <HeaderStyle HorizontalAlign="Center" Width="50px" />
                                                            <ItemStyle HorizontalAlign="Center" />
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridTemplateColumn HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"
                                                            UniqueName="QuantityOpen" AllowFiltering="false" HeaderText="Qty Open">
                                                            <ItemTemplate>
                                                                <asp:Label Text='<%#Eval("_QuantityOpen")%>' ID="lblQuantityOpen" runat="server"></asp:Label><asp:Label
                                                                    Text='<%#Eval("_PreviousQuantityOpen")%>' ID="lblPreviousQuantityOpen" runat="server"
                                                                    Visible="false"></asp:Label></ItemTemplate>
                                                            <HeaderStyle HorizontalAlign="Center" Width="50px" />
                                                            <ItemStyle HorizontalAlign="Center" />
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridBoundColumn AllowFiltering="false" DataField="_Price" DataFormatString="{0:$#.00###}"
                                                            DataType="System.Decimal" HeaderText="Price" SortExpression="_Price" UniqueName="_Price">
                                                            <HeaderStyle Width="50px" />
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="_Project" HeaderText="Project" SortExpression="_Project"
                                                            UniqueName="_Project">
                                                            <HeaderStyle Width="90px" />
                                                        </telerik:GridBoundColumn>
                                                    </Columns>
                                                    <EditFormSettings>
                                                        <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                                        </EditColumn>
                                                    </EditFormSettings>
                                                </MasterTableView>
                                                <FilterMenu EnableImageSprites="False">
                                                </FilterMenu>
                                            </telerik:RadGrid></asp:Panel>
  5. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 15 Jul 2011 Link to this post

    Hi,

    the issue is ajax and i hope you can solve your issue by below methods.

    if you used RadAjaxManager then use below method.
    <script type="text/javascript">
            function onRequestStart(sender, args)
            {
                if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 ||
                        args.get_eventTarget().indexOf("ExportToWordButton") >= 0 ||
                        args.get_eventTarget().indexOf("ExportToCsvButton") >= 0)
                {
                    args.set_enableAjax(false);
                }
            }
        </script>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <ClientEvents OnRequestStart="onRequestStart" />
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadGrid ID="RadGrid1" ID="server" runat="server"/>


    else if you used asp:UpdatePanel then.

    protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) 
        if (e.Item is GridDataItem) 
        
            Button btn = (e.Item as GridDataItem)["TemplateColumn"].FindControl("Button1") as Button; 
            ScriptManager1.RegisterPostBackControl(btn); 
        
        if (e.Item is GridCommandItem) 
        
            Button btncmd = (e.Item as GridCommandItem).FindControl("btnExcel") as Button; 
            ScriptManager1.RegisterPostBackControl(btncmd); 
     
            btncmd = (e.Item as GridCommandItem).FindControl("btnWord") as Button; 
            ScriptManager1.RegisterPostBackControl(btncmd); 
     
            btncmd = (e.Item as GridCommandItem).FindControl("btnCSV") as Button; 
            ScriptManager1.RegisterPostBackControl(btncmd); 
     
            btncmd = (e.Item as GridCommandItem).FindControl("btnPDF") as Button; 
            ScriptManager1.RegisterPostBackControl(btncmd); 
        
    }


    let me know if any concern.

    Thanks,
    Jayesh Goyani
  6. KawaUser
    KawaUser avatar
    57 posts
    Member since:
    Oct 2010

    Posted 15 Jul 2011 Link to this post

    My grid is in a user control I suppose this is going to be a little different. I tried this by putting the code in the UC, but since it is using Ajax proxy, it will not work. So i put it in the page the user control is on and it also did not work. any ideas?
  7. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 15 Jul 2011 Link to this post

    Hi,

    ajaxdemo.ascx
    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ajaxdemo.ascx.cs" Inherits="TelerikTest.Web.usercontrol.ajaxdemo" %>
    <div>
        <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManagerProxy>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
        </telerik:RadAjaxLoadingPanel>
        <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" OnNeedDataSource="RadGrid1_NeedDataSource">
            <MasterTableView PagerStyle-AlwaysVisible="true" CommandItemDisplay="Top">
                <CommandItemSettings ShowExportToExcelButton="true" />
                <Columns>
                    <telerik:GridBoundColumn DataField="ID" HeaderText="ID">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Name" HeaderText="Name">
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </div>

    ajaxdemo.ascx.cs
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Telerik.Web.UI;
     
    namespace TelerikTest.Web.usercontrol
    {
        public partial class ajaxdemo : System.Web.UI.UserControl
        {
            protected void Page_Load(object sender, EventArgs e)
            {
     
            }
            protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
            {
     
                dynamic data = new[] {
                    new { ID = 1, Name ="Name1"},
                    new { ID = 2, Name = "Name2"},
                    new { ID = 3, Name = "Name3"},
                    new { ID = 4, Name = "Name4"},
                    new { ID = 5, Name = "Name5"},
                    new { ID = 6, Name ="Name6"},
                    new { ID = 7, Name = "Name7"},
                    new { ID = 8, Name = "Name8"},
                    new { ID = 9, Name = "Name9"},
                    new { ID = 10, Name = "Name10"},
                    new { ID = 11, Name ="Name11"},
                    new { ID = 12, Name = "Name12"},
                    new { ID = 13, Name = "Name13"},
                    new { ID = 14, Name = "Name14"},
                    new { ID = 15, Name = "Name15"}
                };
     
                RadGrid1.DataSource = data;
            }
        }
    }

    exportwithajax.aspx
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="exportwithajax.aspx.cs"
        Inherits="TelerikTest.Web.exportwithajax" %>
     
    <%@ Register TagPrefix="uc1" Src="~/usercontrol/ajaxdemo.ascx" TagName="ajaxdemo" %>
    <!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>
        <script type="text/javascript">
            function onRequestStart(sender, args) {
                if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 ||
                        args.get_eventTarget().indexOf("ExportToWordButton") >= 0 ||
                        args.get_eventTarget().indexOf("ExportToCsvButton") >= 0) {
                    args.set_enableAjax(false);
                }
            }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server"  />
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" ClientEvents-OnRequestStart="onRequestStart">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="RadButton1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="Label1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
        </div>
        <div>
            <telerik:RadButton ID="RadButton1" runat="server" OnClick="RadButton1_Click" Text="Show current time">
            </telerik:RadButton>
            <asp:Label ID="Label1" runat="server"></asp:Label>
        </div>
        <div>
            <uc1:ajaxdemo ID="uc1Test" runat="server" />
        </div>
        </form>
    </body>
    </html>


    exportwithajax.aspx.cs

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Telerik.Web.UI;
    using TelerikTest.Web.usercontrol;
     
    namespace TelerikTest.Web
    {
        public partial class exportwithajax : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
     
            }
     
            protected void RadButton1_Click(object sender, EventArgs e)
            {
                Label1.Text = DateTime.Now.ToString();
            }
             
        }
    }




    let me know if any concern.

    Thanks,
    Jayesh Goyani
  8. KawaUser
    KawaUser avatar
    57 posts
    Member since:
    Oct 2010

    Posted 15 Jul 2011 Link to this post

    I am not sure I understand. I have a User Control on a page. I am not sure on what your previous post is telling me.

    UCOPOSS:

    <telerik:AjaxSetting AjaxControlID="radGrdCurrentPOLines">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="radGrdCurrentPOLines" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>

    <ExportSettings IgnorePaging="True" OpenInNewWindow="True">
    <Excel FileExtension="xlsx" Format="ExcelML" />
    </ExportSettings>

    BuyerHome.aspx:

    function onRequestStart(sender, args) {
               if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0;
                {
                   args.set_enableAjax(false);
               }
  9. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 16 Jul 2011 Link to this post

    hi,

    You have grid in user control and you used AjaxManagerProxy.
    In your page You used AjaxManager.

    Your Problem is you want to export data to excel but your grid was ajaxify so you are not able to export data.

    Solution :
    Note : i am assuming that you used ajaxManager in your page and ajaxmanagerProxy in your user control.

    In your web page write below code.
    <script type="text/javascript">
            function onRequestStart(sender, args) {
                if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 ||
                        args.get_eventTarget().indexOf("ExportToWordButton") >= 0 ||
                        args.get_eventTarget().indexOf("ExportToCsvButton") >= 0) {
                    args.set_enableAjax(false);
                }
            }
        </script>

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" ClientEvents-OnRequestStart="onRequestStart">
                 
            </telerik:RadAjaxManager>

    If this is not your case, please elaborate the scenario and please provide your code.


    Thanks,
    Jayesh Goyani
  10. KawaUser
    KawaUser avatar
    57 posts
    Member since:
    Oct 2010

    Posted 18 Jul 2011 Link to this post

    I implemented this code and now when I click the excel command item above the grid it gives me null reference exception, object reference...

    Any ideas?

    Thanks,
    Chuck
  11. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 21 Jul 2011 Link to this post

    Hello Chuck,

    Could you please temporary disable AJAX (EnableAJAX="false") to check whether the "Null reference" error is related to the same problem? I would also recommend that you set the UseAllDataFields property to true if you are exporting to ExcelML format.

    Best regards,
    Daniel
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  12. KawaUser
    KawaUser avatar
    57 posts
    Member since:
    Oct 2010

    Posted 25 Jul 2011 Link to this post

    I disabled ajax on the page and changed the grid to use all data fields because I am exporting to excel via excelML, I still get the Null reference exception.

    Thanks,
    Chuck
  13. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 28 Jul 2011 Link to this post

    Hello Chuck,

    Can you please try to isolate the problem in a simple demo as I'm afraid I'm out of ideas as to what might be wrong in your scenario.
    Isolating a problem in a sample project

    Thanks,
    Daniel
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017