Y
yefei
In my web design, I display records from a SQL DataBase according to
some filters
the GridView is defined with select commands and selest parameters
however, I also want to display all records in the database when the
user press a "View All" button.
In this case, I need to change the select comand and clear the
parameters. And I did this in the button_click() event. the GridView
can display desired results when I press the "View All" button,
However, when I click the header to sort, the GridView gone away, like
redered without any data. Press the button again, can show, but not
sorted.
i think it is because of the select command.
when sorting, the SqlDataSource.Select command is the one I
declaratively defined one, not the new one I assigned in the
button_Click() event.
So what Can I do with this to make the select command changed to the
one i want?
some filters
the GridView is defined with select commands and selest parameters
however, I also want to display all records in the database when the
user press a "View All" button.
In this case, I need to change the select comand and clear the
parameters. And I did this in the button_click() event. the GridView
can display desired results when I press the "View All" button,
However, when I click the header to sort, the GridView gone away, like
redered without any data. Press the button again, can show, but not
sorted.
i think it is because of the select command.
when sorting, the SqlDataSource.Select command is the one I
declaratively defined one, not the new one I assigned in the
button_Click() event.
So what Can I do with this to make the select command changed to the
one i want?