Niyazi
09-12-2007, 04:19 PM
Hi Folks!
Assume that I have a GridView (gTest) and SQLDataSource (sTest) on the page.
The page shows the whole data from Table1 as default as in:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
sTest.SelectCommand = "SELECT * FROM Table1"
gTest.DataSourceID = "sTest"
End Sub
If I put a filter button for the gridview that will filter the Table1 data depending on a date, the button event is:
Protected Sub bFilter_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles bFilter.Click
sTest.SelectCommand = "SELECT * FROM Table1 WHERE DateColumn = SomeNewDate"
gTest.DataSourceID = "sTest"
End Sub
After button is fired, gridview is showing up the filtered data.
BUT, when I want to sort the new filtered gridview it loading the old one (which was the default one) and sorting that former gridview.
How can I achieve to sort the filtered gridview?
Thanks,
- Niyazi
Assume that I have a GridView (gTest) and SQLDataSource (sTest) on the page.
The page shows the whole data from Table1 as default as in:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
sTest.SelectCommand = "SELECT * FROM Table1"
gTest.DataSourceID = "sTest"
End Sub
If I put a filter button for the gridview that will filter the Table1 data depending on a date, the button event is:
Protected Sub bFilter_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles bFilter.Click
sTest.SelectCommand = "SELECT * FROM Table1 WHERE DateColumn = SomeNewDate"
gTest.DataSourceID = "sTest"
End Sub
After button is fired, gridview is showing up the filtered data.
BUT, when I want to sort the new filtered gridview it loading the old one (which was the default one) and sorting that former gridview.
How can I achieve to sort the filtered gridview?
Thanks,
- Niyazi