I've got a template column in a datagrid which consists of a dropdownlist. I am handling the selectedindexchanged event of the dropdownlist, no problem. But what I want to do, is this:
If the selected index of the dropdownlist in row #7 changes, I'd like for a textbox in that same row to be enabled.
This was easy with the DataGrid's ItemDataBound event. All I had to do was:
Thing is, I don't know how to access the "correct" textbox or control.Code:DropDownList ddl=(DropDownList)e.Item.FindControl("cmbLeaveType"); string strLeaveType = ddl.SelectedValue.ToString(); TextBox txtTDT = (TextBox)e.Item.FindControl("txtToDateTime"); switch(strLeaveType) { case "LeaveWithoutApplication": txtFDT.Enabled = false; break; // and so on
Any guidance?




Reply With Quote