Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > multiple grids on one page - use single Update/Edit/Cancel commands

Reply
Thread Tools

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

 
 
Iain Porter
Guest
Posts: n/a
 
      12-15-2003
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


 
Reply With Quote
 
 
 
 
Jos
Guest
Posts: n/a
 
      12-15-2003
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


 
Reply With Quote
 
 
 
 
Iain Porter
Guest
Posts: n/a
 
      12-16-2003
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" <(E-Mail Removed)> wrote in message
news:OyUs$(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
Iain Porter
Guest
Posts: n/a
 
      12-16-2003
nevermind... ((DataGrid)sender).EditItemIndex...

Thanks, Iain

"Iain Porter" <(E-Mail Removed)> wrote in message
news:eE7$(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:OyUs$(E-Mail Removed)...
> > 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
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How does one tie multiple interfaces into a single one? larkmore@aol.com Java 3 02-13-2007 04:43 PM
How to put multiple grids on tab strip control using asp.net Syed Hussain via DotNetMonster.com ASP .Net 0 02-09-2005 05:20 PM
multiple grids on one page =?Utf-8?B?SUdvdFlvdXJEb3ROZXQ=?= ASP .Net 0 07-28-2004 01:18 PM
multiple data grids in a same ASPX page Raja ASP .Net Building Controls 0 10-15-2003 04:44 PM
Multiple grids - how to update layout position James G. Beldock ASP .Net 1 07-24-2003 08:29 AM



Advertisments