Event syntax problem to call up the selected event of an ods

M

msch-prv

I would like to raise the selected event of an objectdatasource (ods)
to retrieve some data. I tried to raise this event using a server
button. I am at a loss as to how set up the RaiseEvent syntax
arguments.

Question: is it possible to call this event from a button server
control? Thanks for any pointers.

I tried variations of the following:

Private Event MyodsSelected(ByVal sender As Object, _
ByVal e As
System.Web.UI.WebControls.ObjectDataSourceStatusEventArgs)

Protected Sub btn1_Click(ByVal sender As Object, ByVal e As
System.EventArgs)
Dim sender1 As Object
Dim e1 As System.Web.UI.WebControls.ObjectDataSourceStatusEventArgs
RaiseEvent MyodsSelected(sender1,e1)
End Sub

Protected Sub odsRecipeDet_Selected(ByVal sender As Object,
ByVal e As
System.Web.UI.WebControls.ObjectDataSourceStatusEventArgs)
...
End Sub
 
M

Manu

The Selected event of an ODS is raised by the control when a Select
operation completes (and the data is not cached). You can't generate
this event manually. If you need to perform a Select operation in an
ODS called myODS that is bound to a GridView called myGridView, you
can do:

myGridView.DataSourceID = "myODS" and that should force a Select
operation again, so you'll have the Selecting event raised, then the
data fetched, and then the Selected event raised (if caching was not
used).

I don't understand why do you want to raise the Selected event. If you
can explain your scenario maybe I can help you more.

Regards,
Manuel Abadia

Author of the ExtendedObjectDataSource, a replacement for the
ObjectDataSource with more features. Visit http://www.manuelabadia.com
for more information.
 

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