RowCommand: accessing ObjectDataSource from inside gridview inside a repeater?

Discussion in 'ASP .Net' started by HockeyFan, Jul 3, 2007.

  1. HockeyFan

    HockeyFan Guest

    protected void gvAuthorizedSigners_RowCommand(object sender,
    GridViewCommandEventArgs e)
    {
    if (e.CommandName == "EmptyInsert")
    {
    odsAuthorizedSigners.Insert();
    return;
    }

    if (e.CommandName == "Insert")
    {
    odsAuthorizedSigners.Insert();
    return;
    }
    }

    How do I findcontrol the ObjectDataSource for this gridview.
    Normally, it wouldn't be necessary, but since this RowCommand event
    can happen with any instance of the gridview, since that are multiples
    (since it's inside a repeater), how do I find the ObjectDataSource?
    HockeyFan, Jul 3, 2007
    #1
    1. Advertising

  2. HockeyFan

    Masudur Guest

    On Jul 4, 4:16 am, HockeyFan <> wrote:
    > protected void gvAuthorizedSigners_RowCommand(object sender,
    > GridViewCommandEventArgs e)
    > {
    > if (e.CommandName == "EmptyInsert")
    > {
    > odsAuthorizedSigners.Insert();
    > return;
    > }
    >
    > if (e.CommandName == "Insert")
    > {
    > odsAuthorizedSigners.Insert();
    > return;
    > }
    > }
    >
    > How do I findcontrol the ObjectDataSource for this gridview.
    > Normally, it wouldn't be necessary, but since this RowCommand event
    > can happen with any instance of the gridview, since that are multiples
    > (since it's inside a repeater), how do I find the ObjectDataSource?


    Hi...

    According to your description ,, i can see that you have a repeater
    control and inside the repeater control in item template you have a
    gridview with objectdatasource... .("correct me if i am wront")...
    when you clicked on the grid you want to okay... if you can findgrid
    view why not the objectdatasource then...
    Gridview have a property named "DataSourceID" ... didn't you tried
    that...

    Thanks
    Masudur
    www.kaz.com.bd
    http://munnacs.110mb.com
    Masudur, Jul 4, 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. Replies:
    0
    Views:
    5,805
  2. Zule
    Replies:
    1
    Views:
    5,329
  3. =?Utf-8?B?cGF0cmlja2RyZA==?=

    gridview inside datagrid doen't raise RowCommand event

    =?Utf-8?B?cGF0cmlja2RyZA==?=, Apr 3, 2007, in forum: ASP .Net
    Replies:
    7
    Views:
    2,632
    =?Utf-8?B?cGF0cmlja2RyZA==?=
    Apr 4, 2007
  4. HeavyMetal

    GridView RowCommand problem: GridView Nested in Repeater

    HeavyMetal, Aug 8, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    767
    HeavyMetal
    Aug 8, 2006
  5. HeavyMetal
    Replies:
    0
    Views:
    314
    HeavyMetal
    Aug 14, 2006
Loading...

Share This Page