Mallik Raghu

Mallik Raghu

  • NA
  • 24
  • 0

Paging in GridView in asp.net 2.0

Mar 10 2008 10:13 PM

i am having a gridview with autogenerate cols=false and with paging =true.1 2 3 page nos display.but  when i click on the 2nd page the grid is not visible i mean its vanishing..I got an sqldatasource.Grid is not displayed in page_load.

1.[u]page_load[/u]
if(not postback)
{
//GridView1.visible=false;no gridview binding
}

2.i got a button when clckd the gridview is displayed.in this button_click:

i am giving [b]datasourceid="sqldatasource1" in html page [/b]and i am programatically setting the sqldsource connection string  and command string properties in the [b]codebehind page[/b].

There are some data entry fields and then i [b]insert[/b] a record into the corresponding table of sqldatasource.here i am [b]displaying[/b] the gridview afterbinding ..

Gridview1.DataBind(); as already in html page i mentioned as  gridview's datasourceid="sqldatasource1".then grid is displayed but when i click on the 2nd page number link in the footer of gridview then the gridview is Vanished.. 


Thanks in advance...

 

AMR


Answers (1)