Example :
Assume that you have two dropdownlist inside gridview , One is Department another one is Employee based on Department selection which you want to load Employees.
Sample :
Assume that you have two dropdownlist inside gridview , One is Department another one is Employee based on Department selection which you want to load Employees.
Sample :
protected void ddlDepartment_SelectedIndexChanged(object sender, EventArgs
e)
{
try
{
DropDownList
ddlDepartment = (DropDownList)sender;
GridViewRow
gvr = (GridViewRow)ddl.NamingContainer;
DropDownList
ddlEmployee = gvr.FindControl("ddlEmployee
") as DropDownList;
if
(ddlDepartment.SelectedIndex > 0)
{
//
Load employee details based on department.
}
}
catch (Exception ex)
{
}
}
Very informative post
ReplyDelete