protected void RadTreeView1_NodeEdit(object sender, RadTreeNodeEditEventArgs e) { RadTreeNode nodeEdited = e.Node; string newText = e.Text; nodeEdited.Text = newText; string oldpath = e.Node.Value.Substring(0, e.Node.Value.LastIndexOf("\\") + 1); string oldtext = e.Node.Value.Substring(oldpath.Length); if (nodeEdited.Category == "Files") { getitemonserver(nodeEdited.Category, nodeEdited.Value, oldpath + newText); } else { getitemonserver(nodeEdited.Category, oldpath + oldtext, oldpath + newText); } System.IO.FileSystemWatcher mywatcher = new FileSystemWatcher(oldpath); mywatcher.WaitForChanged(WatcherChangeTypes.All, 2000); createtree(oldpath.Substring(0, oldpath.LastIndexOf("\\"))); //UpdatePanel1.Update(); }
protected void rtvMetricCategory_NodeEdit(object sender, RadTreeNodeEditEventArgs e) { if (string.IsNullOrEmpty(e.Node.Value)) { Guid?ParentID = null; if (e.Node.ParentNode.Value != "0") { ParentID = new Guid(e.Node.ParentNode.Value); } Bll.MetricCategory MetricCategory = new Bll.MetricCategory(); MetricCategory.ParentId = ParentID; MetricCategory.Name = e.Text; MetricCategory.InstanceId = Bll.LinqMicajahDataContext.InstanceId; Guid _InsertedItemID = Bll.MetricCategory.Insert(MetricCategory); e.Node.Expanded = true; } else { if (!String.IsNullOrEmpty(e.Node.Value) && e.Node.Value != "0") { Guid ID = new Guid(e.Node.Value); Bll.MetricCategory.Update(ID, e.Text); } } GenerateTreeView(); }
protected void rtvGCA_NodeEdit(object sender, RadTreeNodeEditEventArgs e) { if (string.IsNullOrEmpty(e.Node.Value)) { Guid?ParentID = null; if (e.Node.ParentNode.Value != "0") { ParentID = new Guid(e.Node.ParentNode.Value); } Bll.GroupCategoryAspect gca = new Bll.GroupCategoryAspect(); gca.ParentId = ParentID; gca.Name = e.Text; Guid _InsertedItemID = MetricTrac.Bll.GroupCategoryAspect.Insert(gca); e.Node.Expanded = true; } else { if (!String.IsNullOrEmpty(e.Node.Value) && e.Node.Value != "0") { Guid ID = new Guid(e.Node.Value); Bll.GroupCategoryAspect.Update(ID, e.Text); } } GenerateTreeView(); }
private void NsTreeView_NodeEdit(object sender, RadTreeNodeEditEventArgs e) { var treeView = Widget as TreeView; if (treeView != null && string.IsNullOrEmpty(treeView.DataTextField) == false ) { var ds = treeView.DataSource; if (ds != null) { var node = ds.GetObjectById(e.Node.Value); node.SetPropValue(treeView.DataTextField, e.Text); ds.Update(node); e.Node.Text = e.Text; } } }
protected void Tree_NodeEdit(object sender, RadTreeNodeEditEventArgs e) { if (e == null) { return; } if (!string.IsNullOrEmpty(e.Text)) { object obj = Support.ConvertStringToType(e.Node.Value, typeof(Guid)); e.Node.Text = e.Text; EntityNodeProvider.UpdateEntityName(((obj == null) ? Guid.Empty : (Guid)obj), e.Text); Bll.Providers.EntityNodeProvider.UpdateEntityNodePath(((obj == null) ? Guid.Empty : (Guid)obj), e.Node.GetFullPath(" > ")); } }
protected void RadTreeView1_NodeEdit(object sender, RadTreeNodeEditEventArgs e) { //string nivelPrefijo = ""; CN_CatCNac_Estructura cm_Estr = new CN_CatCNac_Estructura(model); var estr = new CatCNac_Estructura(); if (e.Node.Value.Contains("Nuevo")) { estr.Id_Matriz = Int32.Parse(Request.QueryString["Id"]); estr.Nivel = e.Node.Level; estr.NombreNodo = e.Text; estr.NodoPadre = Int32.Parse(e.Node.ParentNode.Value); int id = cm_Estr.Alta(estr); e.Node.Value = id.ToString(); listEstructura.Add(estr); } else { estr.Id_Matriz = Int32.Parse(Request.QueryString["Id"]); estr.Nivel = e.Node.Level; estr.NombreNodo = e.Text; estr.NodoPadre = Int32.Parse(e.Node.ParentNode.Value); estr.Id = Int32.Parse(e.Node.Value); int id = cm_Estr.Editar(estr); e.Node.Value = id.ToString(); } //if (e.Node.Level == 1) nivelPrefijo = "[" + matriz.Desc_Nivel_1 + "] - "; //if (e.Node.Level == 2) nivelPrefijo = "[" + matriz.Desc_Nivel_2 + "] - "; //if (e.Node.Level == 3) nivelPrefijo = "[" + matriz.Desc_Nivel_3 + "] - "; //if (e.Node.Level == 4) nivelPrefijo = "[" + matriz.Desc_Nivel_4 + "] - "; //Label etiq2 = new Label(); //e.Node.Controls.Add(etiq2); e.Node.Text = e.Text; var nodoA = treeEstructura.Nodes[0]; var hijosPrimerNodo = listEstructura.Where(x => x.Nivel == 1).ToList(); AgregarControles(ref nodoA, hijosPrimerNodo, null); }
protected void OrgUnitTree_NodeEdit(object sender, RadTreeNodeEditEventArgs e) { errorText.InnerText = ""; errorText.Visible = false; //It seems that it is not enough for the edit to just happen client side. //If this is not done then the changed text reverts after a postback RadTreeNode nodeEdited = e.Node; nodeEdited.Text = e.Text; int orgUnitID = int.Parse(nodeEdited.Attributes["OrgUnitId"]); EF.OrgUnit orgUnit = EF.DataContext.Current.OrgUnits.Include("OrgUnitResources").First(ou => ou.OrgUnitId == orgUnitID); var resourcesToUpdate = EF.DataContext.Current.OrgUnitResources.Include("Resource").Include("OrgUnitresources.resource.ResourceType"); var driversToUpdate = resourcesToUpdate.Where(x => x.OrgUnitId == orgUnitID && x.Resource.ResourceType.ResourceTypeId == (int)eResourceType.Driver).Select(d => d.ResourceId).ToList(); var vehiclesToUpdate = resourcesToUpdate.Where(x => x.OrgUnitId == orgUnitID && x.Resource.ResourceType.ResourceTypeId == (int)eResourceType.Vehicle).Select(v => v.ResourceId).ToList(); UpdateThirdPartyTelematicsDrivers(driversToUpdate); UpdateThirdPartyTelematicsVehicles(vehiclesToUpdate); }
protected void CtlPagesNodeEdit(object sender, RadTreeNodeEditEventArgs e) { var objTabController = new TabController(); var objTab = objTabController.GetTab(int.Parse(e.Node.Value), PortalId, false); if (objTab != null && TabPermissionController.CanManagePage(objTab)) { //Check for invalid if (!IsValidTabName(e.Text) || !IsValidTabPath(objTab, Globals.GenerateTabPath(objTab.ParentId, e.Text))) { e.Node.Text = objTab.TabName; e.Text = objTab.TabName; } else { objTab.TabName = e.Text; objTabController.UpdateTab(objTab); } BindTreeAndShowTab(objTab.TabID); } }
protected void CtlPagesNodeEdit(object sender, RadTreeNodeEditEventArgs e) { var objTabController = new TabController(); var objTab = objTabController.GetTab(int.Parse(e.Node.Value), PortalId, false); if (objTab != null && TabPermissionController.CanManagePage(objTab)) { //Check for invalid string invalidType; if (!TabController.IsValidTabName(e.Text, out invalidType)) { ShowErrorMessage(string.Format(Localization.GetString(invalidType, LocalResourceFile), e.Text)); e.Node.Text = objTab.TabName; e.Text = objTab.TabName; } else if (!IsValidTabPath(objTab, Globals.GenerateTabPath(objTab.ParentId, e.Text))) { e.Node.Text = objTab.TabName; e.Text = objTab.TabName; } else { objTab.TabName = e.Text; objTabController.UpdateTab(objTab); } BindTreeAndShowTab(objTab.TabID); } }
protected void RadTreeView1_NodeEdit(object sender, RadTreeNodeEditEventArgs e) { e.Node.Text = e.Text; }