accessing dropdown inside child grid

Last post 05-09-2008 9:15 AM by dnyandeo.forums@gmail.com. 0 replies.

Sort Posts:

  • accessing dropdown inside child grid

    05-09-2008, 9:15 AM

    Hi

    I have parent grid which is collapsable and inside that there is child grid. I have drop down control inside child contro for status. When I slect status in dropdown, it should update it accordingly. So I am trying following code.

    protected void ddlChildStatusType_SelectedIndexChanged(object sender, EventArgs e)

    {

    GridViewRow Rows = (GridViewRow)(((Control)sender).NamingContainer);GridView ChildGridView = ((GridView)gvMember.Rows[(Convert.ToInt32(Rows.RowIndex))].FindControl("gvChild"));

     

     

    //int i = ChildGridView.SelectedIndex;

    int childId = Convert.ToInt32(((Label)ChildGridView.Rows[(Convert.ToInt32(Rows.RowIndex))].FindControl("lblChildId")).Text);

    int statusId = Convert.ToInt32(((DropDownList)ChildGridView.Rows[(Convert.ToInt32(Rows.RowIndex))].FindControl("ddlChildStatusType")).SelectedValue);

    WiseHealth.Admin.BLL.Member.Member.UpdateMemberStatus(childId, statusId);

    //gvMember.DataBind();

    }

     

    here gVMember is my parent grid and gvChild is child grid,ddlChildStatusType is my dropdown. When I debug above code I find that Rows itself return result zero. But actually there is one row.I try to find out Rowcount it also return zero.

    Please help me to understnd and resolve this issue.

Page 1 of 1 (1 items)