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">
                                    <RowIndicatorColumn>
                                        <HeaderStyle Width="20px"></HeaderStyle>
                                    </RowIndicatorColumn>
                                    <ExpandCollapseColumn>
                                        <HeaderStyle Width="20px"></HeaderStyle>
                                    </ExpandCollapseColumn>                                 
                                    <CommandItemTemplate>
                                   <asp:Button ID="LinkButton1" runat="server" ButtonCssClass="button" Text="Print Selected" OnClientClick="PrintRadGrid(); return false;" />         
                                    </CommandItemTemplate>                              
                                    <Columns>
                                        <telerik:GridBoundColumn HeaderText="Customer ID" DataField="CustomerID" UniqueName="CustomerID">
                                        </telerik:GridBoundColumn>  
                                         <telerik:GridBoundColumn HeaderText="Invoice #" DataField="InvoiceNumber" UniqueName="InvoiceNumber">
                                        </telerik:GridBoundColumn>                                  
                                        <telerik:GridBoundColumn HeaderText="Ship To Terms" DataField="ShipToTerms" UniqueName="ShipToTerms">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn HeaderText="Ship Via" DataField="ShipVia" UniqueName="ShipVia">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn HeaderText="OrderStatus" DataField="OrderStatus" UniqueName="OrderStatus">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridButtonColumn CommandName="Print" ButtonType="PushButton" ButtonCssClass="button" UniqueName="Print" Text="Print" />                                                    
                                     </Columns>       


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

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

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

    Thanks in advance
    Suren

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

    Posted 13 Jul 2011 Link to this post

    Did anybody solve this problem?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 14 Jul 2011 Link to this post

    Hello,

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

    Thanks,
    Shinu.
  5. illumination
    illumination avatar
    85 posts
    Member since:
    May 2008

    Posted 14 Jul 2011 Link to this post

    Hi,
    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" />

     

    </telerik:GridButtonColumn>

    Any other suggestion?
    Thanks.
  6. 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.
  7. Daniel
    Admin
    Daniel avatar
    4946 posts

    Posted 17 Oct 2012 Link to this post

    Hello,

    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,
    Daniel
    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
UI for ASP.NET Ajax is Ready for VS 2017