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

Discussion in 'ASP .Net Datagrid Control' started by MattB, Jul 15, 2004.

  1. MattB

    MattB Guest

    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
    MattB, Jul 15, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tafs7
    Replies:
    0
    Views:
    507
    tafs7
    Dec 29, 2003
  2. tafs7
    Replies:
    2
    Views:
    181
  3. tafs7
    Replies:
    0
    Views:
    204
    tafs7
    Dec 29, 2003
  4. tafs7
    Replies:
    2
    Views:
    217
  5. tafs7
    Replies:
    2
    Views:
    164
Loading...

Share This Page