multiple grids on one page - use single Update/Edit/Cancel commands

Discussion in 'ASP .Net Datagrid Control' started by Iain Porter, Dec 15, 2003.

  1. Iain Porter

    Iain Porter Guest

    Hi - can you access the grid id from DataGridCommandEventArgs ? I have
    multiple similar grids on the one page, and want to use the same events to
    control them, but need to tell it which grid to bind.

    Ta muchely,
    Iain
    Iain Porter, Dec 15, 2003
    #1
    1. Advertising

  2. Iain Porter

    Jos Guest

    Iain Porter wrote:
    > Hi - can you access the grid id from DataGridCommandEventArgs ? I
    > have multiple similar grids on the one page, and want to use the same
    > events to control them, but need to tell it which grid to bind.
    >
    > Ta muchely,
    > Iain


    You can use either e.Item.Parent (e is the DataGridCommandEventArgs),
    or you can use Sender (the first parameter).

    --

    Jos
    Jos, Dec 15, 2003
    #2
    1. Advertising

  3. Iain Porter

    Iain Porter Guest

    So how do I do that? I tried sender.EditItemIndex, but it doesn't work.

    e.Item.Parent also doesn't work. Surely the method doesn't know until
    runtime what is calling it, and hence can't compile specific uses of it.

    Thanks for your help - I'm very .NET OOP naive, so please explain solutions
    fully :0)

    Thanks,
    Iain

    "Jos" <> wrote in message
    news:OyUs$...
    > Iain Porter wrote:
    > > Hi - can you access the grid id from DataGridCommandEventArgs ? I
    > > have multiple similar grids on the one page, and want to use the same
    > > events to control them, but need to tell it which grid to bind.
    > >
    > > Ta muchely,
    > > Iain

    >
    > You can use either e.Item.Parent (e is the DataGridCommandEventArgs),
    > or you can use Sender (the first parameter).
    >
    > --
    >
    > Jos
    >
    >
    Iain Porter, Dec 16, 2003
    #3
  4. Iain Porter

    Iain Porter Guest

    nevermind... ((DataGrid)sender).EditItemIndex...

    Thanks, Iain

    "Iain Porter" <> wrote in message
    news:eE7$...
    > So how do I do that? I tried sender.EditItemIndex, but it doesn't work.
    >
    > e.Item.Parent also doesn't work. Surely the method doesn't know until
    > runtime what is calling it, and hence can't compile specific uses of it.
    >
    > Thanks for your help - I'm very .NET OOP naive, so please explain

    solutions
    > fully :0)
    >
    > Thanks,
    > Iain
    >
    > "Jos" <> wrote in message
    > news:OyUs$...
    > > Iain Porter wrote:
    > > > Hi - can you access the grid id from DataGridCommandEventArgs ? I
    > > > have multiple similar grids on the one page, and want to use the same
    > > > events to control them, but need to tell it which grid to bind.
    > > >
    > > > Ta muchely,
    > > > Iain

    > >
    > > You can use either e.Item.Parent (e is the DataGridCommandEventArgs),
    > > or you can use Sender (the first parameter).
    > >
    > > --
    > >
    > > Jos
    > >
    > >

    >
    >
    Iain Porter, Dec 16, 2003
    #4
    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. James G. Beldock

    Multiple grids - how to update layout position

    James G. Beldock, Jul 24, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    404
    Saravana
    Jul 24, 2003
  2. =?Utf-8?B?U3RldmUgS2FsbGFs?=

    CssClass on DataGrid Edit, Update & Cancel buttons

    =?Utf-8?B?U3RldmUgS2FsbGFs?=, Jul 6, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    720
    =?Utf-8?B?U3RldmUgS2FsbGFs?=
    Jul 6, 2004
  3. =?Utf-8?B?SmFjcXVlcyBMZWNsZXJj?=

    RE: Setting CssClass on Edit, Update & Cancel buttons

    =?Utf-8?B?SmFjcXVlcyBMZWNsZXJj?=, Jul 6, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    494
    =?Utf-8?B?SmFjcXVlcyBMZWNsZXJj?=
    Jul 6, 2004
  4. =?Utf-8?B?SUdvdFlvdXJEb3ROZXQ=?=

    multiple grids on one page

    =?Utf-8?B?SUdvdFlvdXJEb3ROZXQ=?=, Jul 28, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    436
    =?Utf-8?B?SUdvdFlvdXJEb3ROZXQ=?=
    Jul 28, 2004
  5. Craig G
    Replies:
    2
    Views:
    660
    Patrick Olurotimi Ige
    Dec 14, 2004
Loading...

Share This Page