putting a DataGrid Item in a web user control into Editmode from the parent page.

M

MattB

Hello I am trying to put a Datagrid which is in a web user control into
edit mode from the parent page.

Basically I am doing this...

in parent.aspx.cs

myNameSpace.WebUserCtl wuc = (WebUserCtl)Page.FindControl("WebUserCtl");
wuc.SetEditItem();

in WebUserCtl.ascx.cs

public void SetEditItem()
{
DataGrid1.EditItemIndex = 0;
BindGrid();
}

I always set it to 0 as I just want to edit the first item, this should work no?

Thanks ahead for any tips, hints, cheats, or plain outright hacks
Matt
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top