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

Discussion in 'ASP .Net' started by msch-prv@bluewin.ch, Oct 31, 2007.

  1. Guest

    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
    , Oct 31, 2007
    #1
    1. Advertising

  2. Manu Guest

    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.


    On 31 oct, 20:58, wrote:
    > I would like to raise the selected event of anobjectdatasource(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
    Manu, Nov 5, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. robert madrian

    ODS + TableAdapter + Rowcount

    robert madrian, Dec 19, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    385
    robert madrian
    Dec 19, 2005
  2. Andrew Robinson
    Replies:
    1
    Views:
    3,090
    Steven Cheng[MSFT]
    Apr 14, 2006
  3. Sebis
    Replies:
    0
    Views:
    369
    Sebis
    Apr 14, 2006
  4. rroger

    ODS - Incomplete InputParameters

    rroger, Apr 27, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    321
    rroger
    Apr 27, 2006
  5. Larry R

    Updating ODS with FormView

    Larry R, May 18, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    330
    Larry R
    May 18, 2006
Loading...

Share This Page