Monday 11 September 2017

Find Control Under RowCommand

Find Control Under RowCommand


protected void GridViewtemp_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "AddSchedule")
        {
                pnlschedule.Visible = true;
                lblscheduleforItem.Text = e.CommandArgument.ToString();

                GridViewRow row = (GridViewRow)(((ImageButton)e.CommandSource).NamingContainer);
                Label lblDate = (Label)row.Cells[0].FindControl("lblName");
                string teamName = lblDate.Text;
                int rowindex = row.RowIndex;
                lblscheduleforItemName.Text = ((Label)GridViewtemp.Rows[rowindex].FindControl("lblName")).Text;

                      
        }
    }

No comments:

Post a Comment

Print Only Grid View in ASP.net

ASP.net How to Print Only GridView < div id ="gridviewDiv" >   < asp:GridView ID ="gridViewToPri...