The official release of Ext.NET Mobile is now available. Ext.NET Mobile is an ASP.NET component framework for building Phone and Tablet specific mobile web applications. Read More

[CLOSED] How to print gridpanel with data?

  1. #1

    [CLOSED] How to print gridpanel with data?

    How do I print gridpanel data with all display columns ?

    <%@ Page Language="C#" %>
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
            if (!Ext.IsAjaxRequest)
                this.Store1.DataSource = new object[]
                    new object[] {"3m Co", 71.72, 0.02, 0.03, "9/1 12:00am"},
                    new object[] {"Alcoa Inc", 29.01, 0.42, 1.47, "9/1 12:00am"},
                    new object[] {"Altria Group Inc", 83.81, 0.28, 0.34, "9/1 12:00am"}
    <html xmlns="">
    <head id="Head1" runat="server">
        <title>Print </title>
        <form id="form1" runat="server">
            <ext:ScriptManager ID="ScriptManager1" runat="server" />
            <ext:Store ID="Store1" runat="server">
                            <ext:RecordField Name="company" />
                            <ext:RecordField Name="price" Type="Float" />
                            <ext:RecordField Name="change" Type="Float" />
                            <ext:RecordField Name="pctChange" Type="Float" />
                            <ext:RecordField Name="lastChange" Type="Date" DateFormat="n/j h:ia" />
                Title="Array <span class="highlight">Grid</span>" 
              <ext:Toolbar ID="Toolbar2" runat="server">
             <ext:Button ID="Button2" runat="server" Text="Print" Icon="Printer">
                                        <Click Handler="Print?" />
                <ColumnModel ID="ColumnModel1" runat="server">
                        <ext:Column ColumnID="Company" Header="Company" Width="160" Sortable="true" DataIndex="company" />
                        <ext:Column Header="Price" Width="75" Sortable="true" DataIndex="price">
                            <Renderer Format="UsMoney" />
                        <ext:Column Header="Change" Width="75" Sortable="true" DataIndex="change"/>
                        <ext:Column Header="Change" Width="75" Sortable="true" DataIndex="pctChange"/>
                        <ext:Column Header="Last Updated" Width="85" Sortable="true" DataIndex="lastChange">
                            <Renderer Fn="Ext.util.Format.dateRenderer('m/d/Y')" />
                    <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true"/>
    Last edited by Daniil; Sep 27, 2010 at 10:12 PM. Reason: [CLOSED]
  2. #2

    To print a page please use javascript core
    It prints the whole page.
    Respectively, there should be only GridPanel on the page to print this only.

    The alternative way is exporting GridPanel to a format like .csv, .xls, etc.

    An example how to export here
  3. #3
    Thanks Daniil,

    I have a multiple grid controls and some other control on page.
    not suite to me.

    I was expecting any client side event to print store or gridpanel.

    Note: Solved
  4. #4
    Here is the example how to print GridPanel.

Similar Threads

  1. [CLOSED] Print functionality for GridPanel
    By speedstepmem3 in forum 1.x Premium Help
    Replies: 8
    Last Post: Oct 31, 2012, 7:52 PM
  2. Replies: 6
    Last Post: Feb 18, 2011, 3:12 PM
  3. [CLOSED] print
    By majestic in forum 1.x Premium Help
    Replies: 1
    Last Post: Sep 22, 2010, 3:53 PM
  4. Replies: 0
    Last Post: Jun 19, 2009, 5:18 AM
  5. Replies: 4
    Last Post: Nov 17, 2008, 9:16 AM

Tags for this Thread

Posting Permissions