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

I

Iain Porter

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
 
J

Jos

Iain said:
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).
 
I

Iain Porter

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
 

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top