protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e) { if (e.Item is GridEditableItem && e.Item.IsInEditMode) { GridEditableItem item = e.Item as GridEditableItem; GridEditManager manager = item.EditManager; HyperLink hyperLink = (HyperLink)item["OrderTask"].Controls[0]; hyperLink.Visible = false; DropDownList droplist = new DropDownList(); droplist.ID = "DropDownListOrderTask"; droplist.AutoPostBack = true; item["OrderTask"].Controls.Add(droplist); CascadingDropDown ccdOrderTask = new CascadingDropDown(); ccdOrderTask.ID = "ccdOrderTask"; ccdOrderTask.Category = "OrderTask"; ccdOrderTask.TargetControlID = "DropDownListOrderTask"; ccdOrderTask.PromptText = "Select Order Task"; ccdOrderTask.LoadingText = "Loading OrderTask"; ccdOrderTask.ServiceMethod = "BindOrderTask"; ccdOrderTask.ServicePath = "ajaxservice.asmx"; TextBox txt = (TextBox)item["TaskOwner"].Controls[0]; txt.Visible = false; droplist = new DropDownList(); droplist.ID = "DropDownListTaskOwner"; item["TaskOwner"].Controls.Add(droplist); CascadingDropDown ccdTaskOwner = new CascadingDropDown(); ccdTaskOwner.ID = "ccdTaskOwner"; ccdTaskOwner.Category = "TaskOwner"; ccdTaskOwner.ParentControlID = "DropDownListOrderTask"; ccdTaskOwner.TargetControlID = "DropDownListTaskOwner"; ccdTaskOwner.PromptText = "Select Task Owner"; ccdTaskOwner.LoadingText = "Loading Task Owner"; ccdTaskOwner.ServiceMethod = "BindTaskOwner"; ccdTaskOwner.ServicePath = "ajaxservice.asmx"; } }
[WebMethod] public CascadingDropDownNameValue[] BindOrderTask(string knownCategoryValues, string category) { OrderRequestTaskTypeTable _orderRequestTaskTypeTable = new OrderRequestTaskType_List().ExecuteTypedDataTable(); List<CascadingDropDownNameValue> orderTaskDetails = new List<CascadingDropDownNameValue>(); foreach(DataRow dtRow in _orderRequestTaskTypeTable.Rows) { String orderTaskId = dtRow["OrderRequestTaskTypeId"].ToString(); String orderTaskName = dtRow["DescriptionTaskType"].ToString(); //orderTaskDetails.Add(new CascadingDropDownNameValue(orderTaskId, orderTaskName)); orderTaskDetails.Add(new CascadingDropDownNameValue("orderTaskId", "orderTaskName")); } return orderTaskDetails.ToArray(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)