Hi there,
Thanks for your reply. I'm kind of new to this kind of development but this
is what I'm trying to do;
the user will choose a item from a dropdown list and depending on the option
the datasource should call a different store procedure depending on the
parametern (i.e. if user chooses to search the field LastName, datasource
should call a stored procedure that expects a parameter @LastName, that is
going to be supplied through a text box, if the user chooses to search on the
firstname, datasource should call a stored procedure that expects a parameter
@FirstName, that will be supplied through a text box, and so on and so on)
One way of doing this I think is changing the stored procedure name
programatically depending on what the user decides to search on.
Some ideas on how to accomplish this please!!???
Thanks very much,
Manny
"Mikeon" wrote:
> > I am having this problem with a gridview control. what I'm doing is
> > assigning the gridview's datasource to a objectdatasource which calls a
> > parameterized stored procedure and that is all fine.
> >
> > I need to enable the paging and sorting on this gridview, so I have
> > AllowSorting = True and AllowPaging = True on the gridview properties.
> >
> > I know since this gridview data source is being bound programatically, I
> > need to handle the onSorting and PageIndexChanged.
>
> If you are using ObjectDataSource, why are you using the DataSource
> property and not the DataSourceId property? Using the later, frees you
> from having to handle the two events you have mentioned. You just have
> to provide methods with right parameters (i.e.: startindex, pagesize
> and sort expression) depending on the functionallity you want to get.
> Be sure also to check my controls pack at (and related articles on
> problems with ObjectDataSource):
>
> http://vaultofthoughts.net/ASPNETControlsPack.aspx
>
> If for some reason you are bound to using the DataSource property
> programatically, I'm sure there are a lot of articles on handlig paging
> and sorting as for example here:
>
> http://www.c-sharpcorner.com/Code/20...ngInASPNet.asp
>
> --
> Michal
> http://vaultofthoughts.net
>
>