RowCommand: accessing ObjectDataSource from inside gridview inside a repeater?

  • Thread starter Thread starter HockeyFan
  • Start date Start date
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?
 
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
 
Back
Top