RadGrid button Printing row

6 posts, 0 answers
  1. $uren
    $uren avatar
    20 posts
    Member since:
    Apr 2011

    Posted 07 Apr 2011 Link to this post

    <MasterTableView AutoGenerateColumns="False" DataKeyNames="CustomerID">
                                        <HeaderStyle Width="20px"></HeaderStyle>
                                        <HeaderStyle Width="20px"></HeaderStyle>
                                   <asp:Button ID="LinkButton1" runat="server" ButtonCssClass="button" Text="Print Selected" OnClientClick="PrintRadGrid(); return false;" />         
                                        <telerik:GridBoundColumn HeaderText="Customer ID" DataField="CustomerID" UniqueName="CustomerID">
                                         <telerik:GridBoundColumn HeaderText="Invoice #" DataField="InvoiceNumber" UniqueName="InvoiceNumber">
                                        <telerik:GridBoundColumn HeaderText="Ship To Terms" DataField="ShipToTerms" UniqueName="ShipToTerms">
                                        <telerik:GridBoundColumn HeaderText="Ship Via" DataField="ShipVia" UniqueName="ShipVia">
                                        <telerik:GridBoundColumn HeaderText="OrderStatus" DataField="OrderStatus" UniqueName="OrderStatus">
                                        <telerik:GridButtonColumn CommandName="Print" ButtonType="PushButton" ButtonCssClass="button" UniqueName="Print" Text="Print" />                                                    

     protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
            if (e.CommandName == "Print")

    I want to Print the row data when i click the button

     can anyone help with this code it..............

    Thanks in advance

  2. illumination
    illumination avatar
    85 posts
    Member since:
    May 2008

    Posted 13 Jul 2011 Link to this post

    Did anybody solve this problem?
  3. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 14 Jul 2011 Link to this post


    You can follow the the following code library approach to achieve your requirement.
    Print RadGrid contents.

  4. illumination
    illumination avatar
    85 posts
    Member since:
    May 2008

    Posted 14 Jul 2011 Link to this post

    You guys keep giving samples that print the WHOLE grid. I just want the selected row printed using commandname:

    <telerik:GridButtonColumn ButtonType="LinkButton" CommandName="Print" Text="Print" UniqueName="PrintColumn" > 


    <HeaderStyle Width="20px" />


    <ItemStyle HorizontalAlign="Center" />



    Any other suggestion?
  5. EZNet Support
    EZNet Support avatar
    12 posts
    Member since:
    Jul 2012

    Posted 12 Oct 2012 Link to this post

    Did you ever get a resolution to this post? I have the same scenario.
  6. Daniel
    Daniel avatar
    4949 posts

    Posted 17 Oct 2012 Link to this post


    If you examine the contents of the code-library you will notice that it relies on very simple javascript code to print the HTML output of the control together with the CSS styles. That said, you can remove/hide the unwanted parts of this HTML and print whatever part is suitable for your scenario.
    The htmlContent variable contains all the HTML code. Alternatively you can find the desired data item using our API and put only this row's HTML in the htmlContent variable.
    By the way, the print-radgrid-skins-dll.zip is the latest version of this code-library.
    I hope this helps.

    Best regards,
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top