I need to bind the values in the repeater control where I have 4 columns, in the 2 drop-down and 2 text boxes.
My requirement is when I select the first drop-down in first column depending on that selection, balance 3 columns should be get Bind in the repeater in the same row.
for eg
In First column DropDown, when I select the EmployeeName
, next 3columns(AGE,NO,ADDRESS) in the same row in the repeater should be filled automatically.
protected void ddlEmployee_SelectedIndexChanged(object sender, EventArgs e)
{
using (EHSIMSDataContext db = new EHSIMSDataContext(EHSIMSConnectionString.GetConnectionString()))
{
(((sender as DropDownList).Parent).FindControl("email") as TextBox).Text = ;
(((sender as DropDownList).Parent).FindControl("Depart") as TextBox).Text = "Age";
}
}
Repeater Control
protected void rptactions_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
DropDownList ddlemployee = e.Item.FindControl("ddlemployee") as DropDownList;
using (EHSIMSDataContext db = new EHSIMSDataContext(EHSIMSConnectionString.GetConnectionString()))
{
List<EMPLOYEE> objlistemp = (from ct in db.EMPLOYEEs
orderby ct.FIRSTNAME
select ct).ToList<EMPLOYEE>();
ddlemployee.Items.Clear();
ddlemployee.Items.Add(new ListItem("--SELECT--", ""));
foreach (EMPLOYEE emp in objlistemp)
{
ddlemployee.Items.Add(new ListItem(emp.FIRSTNAME, emp.EMPLOYEE_ID.ToString()));
}
}