"If at first you don't succeed; call it version 1.0" :-Unknown

Pages

Monday, February 11, 2013

Bind Dropdown on Footer templete


protected void grdRequestHandling_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            try
            {
                if (e.Row.RowType == DataControlRowType.Footer)
                {
                    DropDownList dropdown = e.Row.FindControl("ddlAddRole") as DropDownList;

                    dropdown.DataSource = objBL.GetRoles();
                    dropdown.DataTextField = "RoleName";
                    dropdown.DataValueField = "RoleId";
                    dropdown.DataBind();
                }
            }
            catch (Exception)
            {
               
            }
        }


If u had any trouble just ask, Happy to help u :)
Stay Tune...
Have a nice day... 'N happy Coding :)

No comments: