protected void ASPxTreeList1_CustomCallback(object sender, TreeListCustomCallbackEventArgs e) { ASPxTreeList tree = sender as ASPxTreeList; TreeListNode deletingNode = tree.FindNodeByKeyValue(e.Argument); DeleteNodeAndChildren(deletingNode, tree); }
protected void tree_CustomCallback(object sender, TreeListCustomCallbackEventArgs e) { if (e.Argument == "edit") { List <TreeListNode> selection = tree.GetSelectedNodes(); if (selection.Count == 0) { return; } foreach (TreeListNode node in selection) { MyProvider.EditList.Add(node.Key); } tree.UnselectAll(); tree.DataBind(); } else if (e.Argument == "cancel") { ResetEditing(); } else if (e.Argument.StartsWith("update")) { string[] data = e.Argument.Substring("update".Length).Split('\n'); if (data.Length > 1) { for (int i = 0; i < data.Length; i += 2) { ObjectDataSource1.UpdateParameters["Id"].DefaultValue = data[i]; ObjectDataSource1.UpdateParameters["Text"].DefaultValue = data[i + 1]; ObjectDataSource1.Update(); } } ResetEditing(); } }
protected void ASPxTreeList1_CustomCallback(object sender, TreeListCustomCallbackEventArgs e) { ASPxTreeList treeList = (ASPxTreeList)sender; treeList.UpdateEdit(); string[] data = e.Argument.Split(new char[] { '|' }); treeList.FindNodeByKeyValue(data[0]).Focus(); for (int i = 0; i < treeList.Columns.Count; i++) { TreeListDataColumn column = (TreeListDataColumn)treeList.Columns[i]; if (column != null) { if (column.FieldName != data[1]) { column.EditCellTemplate = new MyTemplate(); } else { Session["column"] = column.FieldName; column.EditCellTemplate = null; } } } treeList.StartEdit(data[0]); }
protected void tree_CustomCallback(object sender, TreeListCustomCallbackEventArgs e) { if (e.Argument == "upload_complete") { TreeListNode node = tree.FocusedNode; //string folderName = node == null ? FileManagerHelper.RootFolder : node.GetValue(FileManagerHelper.FullPathName).ToString(); string folderName = node == null ? FileManagerHelper.CurrentDataFolder : node.GetValue(FileManagerHelper.FullPathName).ToString(); string uploadedName = FileManagerHelper.EndUploadFile(folderName); if (!string.IsNullOrEmpty(uploadedName)) { if (node != null) { node.Expanded = true; } tree.RefreshVirtualTree(); FocusByPath(uploadedName); } } if (e.Argument == "select_File") { object keyValue = tree.FocusedNode[tree.KeyFieldName]; TreeListNode selectedNode = tree.FocusedNode; string FileName = selectedNode.GetValue("_path").ToString(); DemoRichEdit.Open(FileName); } }
protected void trvEmpleados_CustomCallback(object sender, TreeListCustomCallbackEventArgs e) { string strKey = ""; List <TreeListNode> lstSelectedNodes = trlEmpresaRep.GetSelectedNodes(); foreach (TreeListNode Node in lstSelectedNodes) { strKey += Node.Key + ","; } strKey = strKey.Substring(0, strKey.Length - 1); Session["DepartamentoSelected"] = strKey; DataTable dtbEmpleados = (DataTable)Session[Constantes.SesionTblEmpleadosSm]; String strFilter = Constantes.ColumnaEmpleadoDefaultDepId + " in (" + strKey + ")"; DataRow[] dtrFilter = dtbEmpleados.Select(strFilter); DataTable dtbFilter = dtbEmpleados.Clone(); foreach (DataRow row in dtrFilter) { dtbFilter.ImportRow(row); } Session[Constantes.SesionTblEmpleadosSm1] = dtbFilter; ASPxTreeList treeList = (sender as ASPxTreeList); treeList.DataSource = dtbFilter; treeList.DataBind(); treeList.ExpandAll(); }
protected void ASPxTreeList_Department2_CustomCallback(object sender, TreeListCustomCallbackEventArgs e) { ASPxTreeList_Department2.DataBind(); if (ASPxTreeList_Department2.Nodes.Count > 0) { ASPxTreeList_Department2.Nodes[0].Focus(); } }
protected void treeUnits_OnCustomCallback(object sender, TreeListCustomCallbackEventArgs e) { var list = treeUnits.GetSelectedNodes().Select(node => new OfficeTerritorialUnit { OfficeID = CurrentOffice.ID, TerritorialUnitID = (Guid) node.GetValue("ID") }).ToList(); CreateManager<OfficeTerritorialUnitManager>().SaveAll(list, CurrentOffice.ID); }
protected void ASPxTreeList1_CustomCallback(object sender, TreeListCustomCallbackEventArgs e) { ASPxTreeList1.CollapseAll(); TreeListNode node = ASPxTreeList1.FindNodeByKeyValue(e.Argument); while (node.ParentNode != null) { node.Expanded = true; node = node.ParentNode; } }
protected void treeList_CustomCallback(object sender, TreeListCustomCallbackEventArgs e) { switch (e.Argument) { case "Save": SaveSelection(); break; case "Restore": RestoreSelection(); break; } }
protected void tList_Organization_CustomCallback(object sender, TreeListCustomCallbackEventArgs e) { string[] para = e.Argument.Split('|'); if (para[0] == "Delete") { Guid organId = Guid.Parse(para[1]); NAS.DAL.Nomenclature.Organization.Organization organ = session.GetObjectByKey <NAS.DAL.Nomenclature.Organization.Organization>(organId); organ.RowStatus = Constant.ROWSTATUS_DELETED; organ.Save(); tList_Organization.JSProperties.Add("cpRefresh", "Refresh"); } tList_Organization.DataBind(); }
protected void trlDepartment_CustomCallback(object sender, TreeListCustomCallbackEventArgs e) { string[] p = e.Argument.Split('|'); if (p[0] == "Delete") { Guid departmentId = Guid.Parse(p[1]); NAS.DAL.Nomenclature.Organization.Department department = session.GetObjectByKey <NAS.DAL.Nomenclature.Organization.Department>(departmentId); department.RowStatus = Constant.ROWSTATUS_DELETED; department.Save(); trlDepartment.JSProperties.Add("cpRefresh", "RefreshOnly"); } trlDepartment.DataBind(); }
protected void treelstProductUnits_CustomCallback(object sender, TreeListCustomCallbackEventArgs e) { if (e.Argument == null || e.Argument.Equals(string.Empty)) { return; } string[] para = e.Argument.Split(','); if (para[0].Equals("default")) { Guid key = Guid.Parse(para[1]); itemBO.UpdateDefaultItemUnitOfItem(ItemId, key); } treelstProductUnits.DataBind(); }
protected void trlMenuPrincipal_CustomCallback(object sender, TreeListCustomCallbackEventArgs e) { try { string strKey = e.Argument; Session[Constantes.SessionMenuSeleccionado] = strKey; // Busco la fila según el codigo DataTable dataTable = (DataTable)Session[Constantes.SesionArbol]; DataRow row = dataTable.Rows.Find(new object[] { strKey }); if (row[Constantes.ColumnaArbolUrl].ToString() != string.Empty) { ASPxWebControl.RedirectOnCallback("" + row[Constantes.ColumnaArbolUrl].ToString()); } } catch (Exception ex) { throw; } }
protected void VoucherTree_OnCustomCallback(object Sender, TreeListCustomCallbackEventArgs E) { var arguments = HttpUtility.ParseQueryString(E.Argument); if (arguments["action"] == "delete") { var id = int.Parse(arguments["id"]); if (Voucher.CanDelete(id)) { var repo = new Voucher(); repo.TX(1, string.Format(@" <data> <parent_id>{0}</parent_id> </data>", id)); VoucherTree.DataBind(); } else { throw new Exception("ვაუჩერის წაშლა შეუძლებელია, რადგან გამოყენებულია კამპანიებში."); } } }
protected void ASPxTree_ORG_CustomCallback(object sender, TreeListCustomCallbackEventArgs e) { ASPxTreeList tl = (ASPxTreeList)sender; if (e.Argument.StartsWith("reorder:")) { string[] arg = e.Argument.Split(':'); SwapNodes_ORG(tl.FindNodeByKeyValue(arg[1]), tl.FindNodeByKeyValue(arg[2])); tl.DataBind(); } }
protected void SectionTreeList_CustomCallback(object sender, TreeListCustomCallbackEventArgs e) { }
protected void tgrdAccountBalance_CustomCallback(object sender, TreeListCustomCallbackEventArgs e) { }
protected void tree_CustomCallback(object sender, TreeListCustomCallbackEventArgs e) { UpdateNodes(tree.Nodes); tree.DataBind(); }
private void TreeList_CustomCallback(object sender, TreeListCustomCallbackEventArgs e) { ((ASPxTreeList)sender).FilterExpression = $"[{DisplayColumnName}] Like '%{e.Argument}%'"; }
protected void treeList_CustomCallback(object sender, TreeListCustomCallbackEventArgs e) { string ckey = e.Argument; string[] arguments = e.Argument.Split('|'); if (arguments[0] == "INSERT") { string vistext = arguments[1]; string type = arguments[2]; string required = arguments[3]; string notes = arguments[4]; string parent = arguments[5]; string condition = arguments[6]; string checklistckey = ddChecklists.SelectedValue; List <ChecklistTemplateVersion> versions = ChecklistTemplateVersion.GetChecklistTemplateVersions(decimal.Parse(checklistckey)); decimal templateversionckey = versions[0].ChecklistTemplateVersionCKey; DropDownList Protocols = (DropDownList)Master.FindControl("ContentPlaceHolder_Menu").FindControl("protocols"); decimal protocolversion = decimal.Parse(txtProtocolVersion.Text); int sortorder = 0; //current item is the parent of new item; sort order of new item is 1 larger than that of parent, so that it becomes the first child when ordered if (parent == "") { sortorder = 9999999; //large number so that it goes to the bottom } else { sortorder = ChecklistTemplateItems.GetSortOrder(decimal.Parse(parent)); } if (parent == "") { ChecklistTemplateItems.AddChecklistItem(templateversionckey, protocolversion, null, vistext, null, null, null, null, int.Parse(type), int.Parse(required), condition, false, false, false, false, sortorder + 1, notes); } else { ChecklistTemplateItems.AddChecklistItem(templateversionckey, protocolversion, decimal.Parse(parent), vistext, null, null, null, null, int.Parse(type), int.Parse(required), condition, false, false, false, false, sortorder + 1, notes); } } else if (arguments[0] == "RESTORE") { string retval = ChecklistTemplateItems.RestoreChecklistItem(decimal.Parse(arguments[1])); } else if (arguments[0] == "DELETE") { string key = arguments[1]; if (ChecklistTemplateItems.CanDelete(decimal.Parse(key), 0)) { ChecklistTemplateItems.DeleteChecklistItemHard(decimal.Parse(key)); } } else if (arguments[0] == "SETIMAGE") { TreeListNode node = treeList.FindNodeByKeyValue(arguments[1]); } LoadChecklists(); BindChecklists(); LoadChecklistItems(); BindChecklistTree(); }
protected void tlData_CustomCallback(object sender, TreeListCustomCallbackEventArgs e) { TreeListNodeCollection siblingNodes; ASPxTreeList treeList = sender as ASPxTreeList; Dictionary <string, int> SortIndex = Session[treeList.UniqueID + "_Sort"] as Dictionary <string, int>; if (e.Argument == "MOVEUP" || e.Argument == "MOVEDOWN") { siblingNodes = (treeList.FocusedNode.ParentNode == null) ? treeList.Nodes : treeList.FocusedNode.ParentNode.ChildNodes; int siblingCount = siblingNodes.Count; int Index = SortIndex[treeList.FocusedNode.Key]; int NewIndex = Index; if (e.Argument == "MOVEUP") { NewIndex = (Index == 0) ? Index : Index - 1; } if (e.Argument == "MOVEDOWN") { NewIndex = (Index == (siblingCount - 1)) ? Index : Index + 1; } foreach (TreeListNode node in siblingNodes) { if (SortIndex[node.Key] == NewIndex) { SortIndex[treeList.FocusedNode.Key] = NewIndex; SortIndex[node.Key] = Index; break; } } } if (e.Argument.Contains("DRAGNODE")) { string[] swapKeys = e.Argument.Remove(0, 8).Split('|'); TreeListNode draggingNode = treeList.FindNodeByKeyValue(swapKeys[0]); TreeListNode targetNode = treeList.FindNodeByKeyValue(swapKeys[1]); if ((draggingNode != null) && (targetNode != null)) { siblingNodes = (targetNode.ParentNode == null) ? treeList.Nodes : targetNode.ParentNode.ChildNodes; int targetIndex = SortIndex[targetNode.Key]; int draggingIndex = SortIndex[draggingNode.Key]; int draggingDirection = (targetIndex < draggingIndex) ? 1 : -1; foreach (TreeListNode node in siblingNodes) { if ((SortIndex[node.Key] > Math.Min(targetIndex, draggingIndex)) && (SortIndex[node.Key] < Math.Max(targetIndex, draggingIndex))) { SortIndex[node.Key] += draggingDirection; } } SortIndex[draggingNode.Key] = targetIndex; SortIndex[targetNode.Key] = targetIndex + draggingDirection; } } treeList.DataBind(); UpdateTreeListButtons(treeList); }
protected void treeList_Callback(object sender, TreeListCustomCallbackEventArgs e) { ASPxTreeList tree = sender as ASPxTreeList; if (e.Argument.ToString() != "" && e.Argument.Length > 1) { hiddenIdEmp.Value = e.Argument.ToString().Substring(1); string idEmp = e.Argument.ToString().Substring(1); decimal UnitPerentId = 0, UnitChildId = 0; UnitChildId = objEmployees.GetEmployees(Convert.ToInt32(idEmp)).unitid; UnitPerentId = objUnit.GetUnit(objEmployees.GetEmployees(Convert.ToInt32(idEmp)).unitid).parentid; foreach (TreeListNode nodeParent in tree.Nodes) { if (Convert.ToDecimal(nodeParent.Key.Substring(1)) == UnitPerentId) { nodeParent.Expanded = true; foreach (TreeListNode p in nodeParent.ChildNodes) { if (p.Key.Contains("u")) { if (p.Expanded) { p.Expanded = false; } if (Convert.ToDecimal(p.Key.Substring(1)) == UnitChildId) { p.Expanded = true; foreach (TreeListNode c in p.ChildNodes) { if (Convert.ToDecimal(idEmp) == Convert.ToDecimal(c.Key.Substring(1))) { c.Expanded = true; c.Focus(); } } } } } } else { if (nodeParent.Expanded) { nodeParent.Expanded = false; } TreeListNode nodeParentC2 = tree.FindNodeByKeyValue(UnitChildId.ToString()); if (nodeParentC2 != null) { nodeParentC2.Expanded = true; foreach (TreeListNode c in nodeParentC2.ChildNodes) { if (c.Expanded) { c.Expanded = false; } if (Convert.ToInt32(idEmp) == Convert.ToInt32(c.Key.Substring(1))) { c.Expanded = true; c.Focus(); } } } } } } tree.RefreshVirtualTree(); }
protected void treeUnits_OnCustomCallback(object sender, TreeListCustomCallbackEventArgs e) { _regionId = GetValue<Guid?>(ddlUnits); BindTree(); }