Prev: slow population of dropdown using IE8
Next: CalendarExtender.SelectedDate without populating text box
From: Iain on 1 Oct 2009 11:00 All, When changing the display of a GridView with : SqlDataSource1.SelectCommand = "SELECT ....blah blah" SqlDataSource1.DataBind(); After the result set changes within the Gridview the paging no longer works, is there a way to re-page the control so it works correctly on the newly displayed data. Regards Iain
From: Alexey Smirnov on 1 Oct 2009 11:09 On Oct 1, 5:00 pm, Iain <i...(a)test.co.uk> wrote: > All, > > When changing the display of a GridView with : > > SqlDataSource1.SelectCommand = "SELECT ....blah blah" > SqlDataSource1.DataBind(); > > After the result set changes within the Gridview the paging no longer > works, is there a way to re-page the control so it works correctly on > the newly displayed data. > > Regards > Iain What do you mean, why it no longer works? You probably need to set PageIndex back to 0. Please look here for more examples: http://msdn.microsoft.com/en-us/library/aa479347.aspx
From: Iain on 1 Oct 2009 11:14 Alexey Smirnov wrote: > > What do you mean, why it no longer works? You probably need to set > PageIndex back to 0. Please look here for more examples: > http://msdn.microsoft.com/en-us/library/aa479347.aspx Clicking on the pages seems to revert back to the previous result set. I'll have a look at the suggested example! Cheers Alexey.
From: Alexey Smirnov on 1 Oct 2009 11:28 On Oct 1, 5:14 pm, Iain <i...(a)test.co.uk> wrote: > Alexey Smirnov wrote: > > > What do you mean, why it no longer works? You probably need to set > > PageIndex back to 0. Please look here for more examples: > >http://msdn.microsoft.com/en-us/library/aa479347.aspx > > Clicking on the pages seems to revert back to the previous result set. > I'll have a look at the suggested example! > > Cheers Alexey. It would be good to see your code. Maybe I can find the error there
From: Iain on 2 Oct 2009 04:21
Alexey Smirnov wrote: >> >> Cheers Alexey. > > It would be good to see your code. Maybe I can find the error there Code below, in a simplfied form : I have a Button & a TextBox on a form and on the click of the button I perform the following : SqlDataSource1.SelectCommand = "SELECT id from mytable where name = '" + TextBoxSearch.Text + "'"; SqlDataSource1.DataBind(); After applying the above the GridView refreshes as expected BUT clicking on the page numbers within the GridView doesn't work as expected, it displays records from the previous search. |