3
3P
I would like to create a very simple form.
When client enters it he has a filter to set. Then push the button get the
data and display in GridView.
Grid uses ObjectDataSource and allows paging and sorting (using custom
stored proc returning only data needed on current page).
But seems that ObjectDataSource is refreshing data on every postback. It's
not ok because dropdowns in
filter also postback thus I hit the database and display data before
filter is set and before client
pushes the button. Plus it hits the database on first PageLoad.
Is there any way to prevent such a behaviour of ObjectDataSource? Or is
there a way to do it w/o ObjectDatasource?
Other then inheriting from GridView and overriding InitializePager (or sth
like that). I cannot find a way to tell
the grid how many records there is so it can generate the Pager.
I thought I found the solution by handling the Selecting event and
canceling it until user pushes the button. But when
there is data in grid and I cancel Selecting event the data in grid is
cleared :/
If it is not possible with ObjectDataSource, then I really don't know what
this control is for. Then it's totally unusable
for other then maybe one or two simplest solutions.
3P
When client enters it he has a filter to set. Then push the button get the
data and display in GridView.
Grid uses ObjectDataSource and allows paging and sorting (using custom
stored proc returning only data needed on current page).
But seems that ObjectDataSource is refreshing data on every postback. It's
not ok because dropdowns in
filter also postback thus I hit the database and display data before
filter is set and before client
pushes the button. Plus it hits the database on first PageLoad.
Is there any way to prevent such a behaviour of ObjectDataSource? Or is
there a way to do it w/o ObjectDatasource?
Other then inheriting from GridView and overriding InitializePager (or sth
like that). I cannot find a way to tell
the grid how many records there is so it can generate the Pager.
I thought I found the solution by handling the Selecting event and
canceling it until user pushes the button. But when
there is data in grid and I cancel Selecting event the data in grid is
cleared :/
If it is not possible with ObjectDataSource, then I really don't know what
this control is for. Then it's totally unusable
for other then maybe one or two simplest solutions.
3P