Confused about Gridview and DataSourceID

D

dgk

I have a gridview for which the datasource at design time is a method
that returns a collections.generic.List (of MyClass). That created an
ObjectDataSource1 which is the DataSourceID for the gridview. At run
time I figured that I would just set the datasource to another List
(of MyClass) which I'm actually generating on the fly.

That works, but the GV can't be sorted because that relies on the
DataSourceID which has to be wiped when I set the DataSource of the GV
directly.

So, I tried to use the method that returns the list to really do the
work, but I can't figure out how to pass in the parameters that will
be required. I tried setting the ObjectDataSource1.SelectParameters to
what needs to be passed to the method but I can't get the syntax
right.

Any help greatly appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top