| Author: vadivukarasi 23 Aug 2007 | Member Level: Gold | Rating:  Points: 2 |
U are having 3 dropdownlists at the time of user clicked edit.
If user selects the department, the corresponding phone no and fax no of the particular department should appear.
create the onchange javascript function for the 1st dropdownlist(department) In the other 2 drop down list u are binding DeptId as value , Phone no and Fax no as display text respectively
In the ItemDataBound of the Datagrid
DropDownList ddldept1 = (DropDownList)e.Item.FindControl("ddlDept"); DropDownList ddlfax1 = (DropDownList)e.Item.FindControl("ddlFaxNo"); DropDownList ddlphone1 = (DropDownList)e.Item.FindControl("ddlPhoneNo");
ddldept1.Attributes["onchange"] = "javascript:selectPhoneFax('"+ddldept1.ClientID+"','"+ddlfax1.ClientID+"','"+ddlphone1.ClientID+"');"
javascript function
function SelectPhoneFax(dept,fax,phone) { GetObject(fax).value = Getobject(dept).value; GetObject(phone).value = Getobject(dept).value;
} function GetObject(ctrlname) { return document.getElementById(ctrlname); }
|
| Author: Angelo Arzaga 05 Sep 2007 | Member Level: Bronze | Rating:  Points: 2 |
Still unresolved
|