zoukankan      html  css  js  c++  java
  • devexpress中如何绑定ASPxTreeList控件

    效果图:

    //前端控件代码:

     <dx:ASPxTreeList ID="Tree_Gooslist" AutoGenerateColumns="False" ClientInstanceName="Tree_Gooslist" Width="20%" runat="server" KeyFieldName="cateid" ParentFieldName="parentid" Theme="Mulberry"
                        OnNodeUpdating="Tree_Gooslist_NodeUpdating" OnNodeDeleting="Tree_Gooslist_NodeDeleting" OnNodeInserting="Tree_Gooslist_NodeInserting" OnCellEditorInitialize="Tree_Gooslist_CellEditorInitialize"
                         OnNodeValidating="Tree_Gooslist_NodeValidating1" OnHtmlRowPrepared="Tree_Gooslist_HtmlRowPrepared">
    
                        <ClientSideEvents Init="TreeNodeClick" FocusedNodeChanged="TreeNodeClick" EndCallback="tree_EndCallback" />
                        <SettingsPager>
                            <FirstPageButton Visible="false" />
                            <LastPageButton Visible="false" />
                            <NextPageButton Visible="false" />
                            <PrevPageButton Visible="false" />
                            <PageSizeItemSettings Visible="false" />
    
                        </SettingsPager>
    
                        <Styles>
                            <AlternatingNode BackColor="Yellow">
                                <Border BorderWidth="0" BorderColor="Transparent" />
                            </AlternatingNode>
                            <Header HorizontalAlign="Center"></Header>
                            <Header CssClass="tw-dtheader" HorizontalAlign="Center"></Header>
                            <CommandCell CssClass="tw-commandColumn"></CommandCell>
                            <FocusedNode CssClass="tw-focusRow"></FocusedNode>
                            <%--<CommandColumn CssClass="tw-commandColumn"></CommandColumn>
                                   <CommandColumnItem CssClass="tw-commandColumnBtn"></CommandColumnItem>
                                   <FocusedRow CssClass="tw-focusRow"></FocusedRow>--%>
                        </Styles>
                        <SettingsPopupEditForm Modal="true" HorizontalAlign="WindowCenter" VerticalAlign="WindowCenter" />
    
                        <Settings ShowColumnHeaders="true" ShowTreeLines="false" GridLines="Both" />
                        <SettingsBehavior AllowFocusedNode="true" AllowDragDrop="true" ProcessSelectionChangedOnServer="false" />
    
                        <Border BorderWidth="1" BorderColor="Transparent" />
                        <Columns>
                            <dx:TreeListDataColumn FieldName="catename" Caption="分类名称" AllowSort="False" Width="10%"></dx:TreeListDataColumn>
                            <dx:TreeListComboBoxColumn FieldName="pricerange" Caption="价格范围" AllowSort="False" Width="5%"></dx:TreeListComboBoxColumn>
                            <dx:TreeListComboBoxColumn FieldName="PARENTID" Caption="父id" AllowSort="False" Visible="false" Width="5%"></dx:TreeListComboBoxColumn>
                            <dx:TreeListComboBoxColumn FieldName="LAYER" Caption="层级" AllowSort="False" Visible="false" Width="5%"></dx:TreeListComboBoxColumn>
                            <dx:TreeListCommandColumn Caption="功能" Width="5%">
    
                                <NewButton Visible="true" Text="[新增]"></NewButton>
                                <EditButton Visible="true" Text="[修改]"></EditButton>
                                <DeleteButton Visible="true" Text="[删除]"></DeleteButton>
    
                                <%-- <UpdateButton Visible="true" Text="[修改]"></UpdateButton>--%>
    
                                <%--   <CustomButtons >
                                            <dx:TreeListCommandColumnCustomButton></dx:TreeListCommandColumnCustomButton>
                                         </CustomButtons>--%>
                            </dx:TreeListCommandColumn>
                        </Columns>
    </dx:ASPxTreeList>
    View Code

    //后台数据绑定代码:调用的存储过程

    private void showGoodsListTree()
    {
    DataSet ds = new DataSet();
    //ds=goodsmanagebll.
    ds = goodsmanagebll.Get_categoriesTreee();
    Tree_Gooslist.DataSource = ds.Tables[0];
    Tree_Gooslist.DataBind();

    }

  • 相关阅读:
    git merge 和 git rebase 的使用场景
    Xcode 报错:解决 Could not attach to pid : "xx" 不重开工程的杀手锏
    软件设计模式的7条原则
    iOS开发信号量的使用
    利用SAMKeyChain生成唯一设备号
    iOS Fundation和CoreFoundation的对象转换内存管理权问题
    已有的PHP安装gd扩展
    centos7 编译安装 php7.4
    Nacos集群模式部署步骤
    搭建 Apache RocketMQ 单机环境
  • 原文地址:https://www.cnblogs.com/dfxyw/p/5080192.html
Copyright © 2011-2022 走看看