RowCommand: accessing ObjectDataSource from inside gridview inside a repeater?

H

HockeyFan

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?
 
M

Masudur

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
 

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,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top