Hi Friends,
I have a page with searching relevant parameters with Gridview listing.The gridview is placed inside a div which has scroll bars. When i click to print button, i want to print gridview data. How can i do this?
help me if u have any idea?
Thanks in advance
Dinesh Kumar
Loading
Lalit MPosted Dec 8, 2009, 11:46 PM
1) create simple web application (here i used asp.net with C#).
2) put following control in to Page.
1) Gridview (id = GridView1)
2) html button (id =Button1)
<inputid="Button1?type="button"value="Print"language="javascript"onclick="return Button1_onclick()" />
<asp:GridViewID="GridView1?runat="server">
asp:GridView>
3) fill data into GridView
//here i used the list you can bind with database also
System.Collections.Generic.List<string> obj = newSystem.Collections.Generic.List<string>();
for(inti = 0; i < 10; i++)
more reference link{
obj.Add(i.ToString());
}
GridView1.DataSource = obj;
GridView1.DataBind();
4) now write the print function. click on the Button1 or write Java Script.
Reference link1 .. Thanks ...