Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. to print datagrid control in asp.net 2k3

to print datagrid control in asp.net 2k3

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptasp-netcom
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RPS Sidhu
    wrote on last edited by
    #1

    I am making a keyword research tool for my website where the keyword info and the similar displayed in datagrid controls. i want to print or save the data in datagrid control only, not the whole page. I know the javascript command to print the whole page window.print() .But i have to print the datagrid control oany. can somebody tell me... u can visit my url at: http://inabrains.com/keyword_research.aspx[^]

    G 1 Reply Last reply
    0
    • R RPS Sidhu

      I am making a keyword research tool for my website where the keyword info and the similar displayed in datagrid controls. i want to print or save the data in datagrid control only, not the whole page. I know the javascript command to print the whole page window.print() .But i have to print the datagrid control oany. can somebody tell me... u can visit my url at: http://inabrains.com/keyword_research.aspx[^]

      G Offline
      G Offline
      gyokusei
      wrote on last edited by
      #2

      Hi raj1984, try this: 1. Add a div tag on your page and give it an ID (ex: divGrid) 2. Add your datagrid control into the div. 3. Add an button and write to onclick event, which will open a new blank page. 4. Add all HTML tag in divGrid to the new page. ex: <div id='divGrid'> <asp:DataGrid.... </div> <input type='button' onclick.='doPrint();'> doPrint method: function doPrint() { var subwin = window.open("_blank"); // you can open an existing page var d = document.getElementById("divGrid"); subwin.document.write(d.innerHTML); subwin.print(); }

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups