zoukankan      html  css  js  c++  java
  • (DevExpress2011控件教程)ASPXTreeList 范例2: ASPxTreeList杂项设置

    1、交替的节点颜色设置

    属性—>Styles->AlternationgNode->BackColor

     

    2、网格线与树线条

    属性->Settings->GridLines

    属性->Settings->ShowTreeLines

     

    3、条件格式

     ASPxTreeList允许你对个别数据Cell或者是完整节点设置个性化样式设计 ,你可以使用HtmlDataCellPrepared or HtmlRowPrepared 方法去设置你需要的设置

    例如上例中添加

    protected void treeList_HtmlDataCellPrepared(object sender, DevExpress.Web.ASPxTreeList.TreeListHtmlDataCellEventArgs e)

            {

                if (Object.Equals(e.GetValue("dptname"), "部门1A"))

                    e.Cell.Font.Bold = true;

            }

    4、节点

    多行选择

    1.     SettingsSelection.Enabled 属性设置为True

    2.     SettingsSelection.AllowSelectAll 属性设置为 true

    3.     SettingsSelection.Recursive 反选属性设置为true

    5、数据导出

    ASPxTreeList 很容易的使用ASPxTreeListExporter组件导出数据

    treeListExporter.WriteRtfToResponse();

    treeListExporter.WriteXlsxToResponse();

    treeListExporter.WriteXlsToResponse();

    treeListExporter.WritePdfToResponse();

     

    6、数据分页

     SettingsPager.Mode 属性设置为 ShowPager.

    7、数据统计

    AspxTreeList 能使你进行单列或一组节点的计算统计,显示的结果在页脚的单元。AspxTreeList提供5个嵌入聚集函数 count ,max,min等等)

    步骤一 把Settings.ShowFooter属性设置为 true.

    步骤二 组页脚显示 Settings.ShowGroupFooter属性设置为 true.

     <Settings ShowGroupFooter="True" ShowFooter="True" GridLines="Both" />

      <Summary>
                
    <dx:TreeListSummaryItem FieldName="dptname" ShowInColumn=" dptname " SummaryType="Count" />
           
    </Summary>

     如果在代码里写。。。

    private void TreeDataBind()

                {

                   string Sql="select * from com_Dpt";

                   DataSet ds= db.ExecuteDataSet(System.Data.CommandType.Text, Sql);

                   treeList.DataSource =ds.Tables[0];

                   treeList.KeyFieldName = "dptid";

                   treeList.ParentFieldName = "dptfatherid";

                   TreeListSummaryItem a = new TreeListSummaryItem();

                   a.FieldName = "dptName";

                   a.ShowInColumn = "dptName";

                   a.SummaryType = DevExpress.Data.SummaryItemType.Count ;

                    treeList.Summary.Add(a);

                    treeList.DataBind();

                  

                }

  • 相关阅读:
    angular学习笔记(二十五)-$http(3)-转换请求和响应格式
    angular学习笔记(二十四)-$http(2)-设置http请求头
    angular学习笔记(二十三)-$http(1)-api
    Replace 在动态sql中的实现
    SQL 中 replace 替换字符串中的字符 ''
    sqlserver 时间字符串转化为时间格式
    update set where exists 多表更新 在mssql、MySQL、Oracle中分别用法
    LPAD在Oracle中和 mssql以及在MySQL中的不同用法 以及调用存储过程方法
    支付宝对账单下载Java正式商户调用
    支付宝对账单下载Java沙箱调用
  • 原文地址:https://www.cnblogs.com/meetweb/p/2155138.html
Copyright © 2011-2022 走看看