You must Sign In to post a response.
  • Category: ASP.NET

    In runtime i need to visible the bind data in gridview in

    in a gridview i show the following data

    name adres mobile

    celv chennai 880*****

    mani Sivagangai 770763****

    if i click the print button i need to print the following data in runtime

    name adres

    celv chennai

    mani Sivagangai
  • #762328
    Hi Selvi,

    If you want to print your result then my suggestion is open your result set in new window and using javascript you can print your result by using window.print() function.


    Hope this will helpful to you...

    Give respect to your work, Instead of trying to impress your boss.

    Blog :

  • #762341
    You can do one thing try to print javascript function try this code working for me.

    Step1: Sql Server Side

    Create Table TblNmlist
    name varchar(40),
    adres varchar(40),
    mobile varchar(40)

    Insert into TblNmlist values('celv','chennai ','880*****')
    Insert into TblNmlist values('mani','Sivagangai ','770763****')

    Select * from TblNmlist

    Aspx Page this

    function hideColumn() {
    var gridrows = $("#Grd1 tbody tr");

    for (var i = 0; i < gridrows.length; i++) {
    gridrows[i].cells[2].style.display = "none";
    return false;



    <asp:Button ID="bt1" runat="server" Text="Print11111" OnClick="bt1_Click" OnClientClick="return hideColumn();" />

    Server Side C# Code

    DataTable dt = new DataTable();
    SqlDataAdapter sqladp = new SqlDataAdapter("Select * from TblNmlist", con);
    Grd1.DataSource = dt;

    I have attached Snapshot check them

    Name : Dotnet Developer-2015
    Email Id :

    'Not by might nor by power, but by my Spirit,' says the LORD Almighty.

    Delete Attachment

  • #762352
    hi kumar vill u plz share ur source

  • #762374

    sorry i forgot client side just copy and paste this code . if you need change this fields.

    <asp:GridView ID="Grd1" runat="server" AutoGenerateColumns="false">
    <asp:BoundField DataField="name" HeaderText="name" />
    <asp:BoundField DataField="adres" HeaderText="adres" />
    <asp:BoundField DataField="mobile" HeaderText="mobile" />

    Name : Dotnet Developer-2015
    Email Id :

    'Not by might nor by power, but by my Spirit,' says the LORD Almighty.

  • #762393


    Delete Attachment

  • Sign In to post your comments