Ejemplo n.º 1
0
        public void TranslateASPxControl(object c)
        {
            //Type t = c.GetType();
            //System.Reflection.PropertyInfo p = t.GetProperty("SettingsText");
            //object obj = p.GetValue(c, null);

            if (c.GetType() == (new DevExpress.Web.ASPxTreeList.ASPxTreeList()).GetType())
            {
                DevExpress.Web.ASPxTreeList.ASPxTreeList cc = c as DevExpress.Web.ASPxTreeList.ASPxTreeList;
                cc.SettingsText.CommandCancel        = "取消";
                cc.SettingsText.CommandDelete        = "删除";
                cc.SettingsText.CommandEdit          = "编辑";
                cc.SettingsText.CommandNew           = "新增";
                cc.SettingsText.CommandUpdate        = "更新";
                cc.SettingsText.ConfirmDelete        = "确认删除?";
                cc.SettingsText.LoadingPanelText     = "正在载入...";
                cc.SettingsText.RecursiveDeleteError = "该节点还有子节点,无法直接删除!";
                //DevExpress.Web.ASPxTreeList.TreeListCommandColumn tcc = cc.Columns["EditColumn"] as DevExpress.Web.ASPxTreeList.TreeListCommandColumn;
            }
            if (c.GetType() == (new DevExpress.Web.ASPxGridView.ASPxGridView()).GetType())
            {
                DevExpress.Web.ASPxGridView.ASPxGridView gv = c as DevExpress.Web.ASPxGridView.ASPxGridView;
                gv.SettingsText.CommandCancel = "取消";
                gv.SettingsText.CommandDelete = "删除";
                gv.SettingsText.CommandEdit   = "编辑";
                gv.SettingsText.CommandNew    = "新增";
                gv.SettingsText.CommandSelect = "选取";
                gv.SettingsText.CommandUpdate = "更新";
                gv.SettingsText.ConfirmDelete = "确认删除?";
                gv.SettingsEditing.Mode       = DevExpress.Web.ASPxGridView.GridViewEditingMode.PopupEditForm;
                gv.SettingsText.EmptyDataRow  = "没有发现数据";
                //gv.Styles.GroupPanel.HorizontalAlign = HorizontalAlign.Right;
            }
        }
Ejemplo n.º 2
0
    protected void treeList_CustomJSProperties(object source, DevExpress.Web.ASPxTreeList.TreeListCustomJSPropertiesEventArgs e)
    {
        DevExpress.Web.ASPxTreeList.ASPxTreeList treelist = (DevExpress.Web.ASPxTreeList.ASPxTreeList)source;
        ICollection <DevExpress.Web.ASPxTreeList.TreeListNode> listNodes = treelist.GetAllNodes();

        object[] FullNames   = new object[listNodes.Count];
        object[] ParentCodes = new object[listNodes.Count];
        object[] Codes       = new object[listNodes.Count];
        object[] Keys        = new object[listNodes.Count];
        int      i           = 0;

        foreach (DevExpress.Web.ASPxTreeList.TreeListNode node in listNodes)
        {
            FullNames[i]   = node["FullName"];
            Codes[i]       = node["Code"];
            ParentCodes[i] = node["ParentCode"];
            Keys[i]        = node["ID"];
            ++i;
        }
        e.Properties["cpFullNames"]   = FullNames;
        e.Properties["cpCodes"]       = Codes;
        e.Properties["cpKeys"]        = Keys;
        e.Properties["cpParentCodes"] = ParentCodes;
    }