treelist去掉根节点按钮效果图:

//去掉父节点及子节点旁的新增、修改、删除操作(写在onCommandColumnButtonInitialize事件中)
protected void Tree_Gooslist_CommandColumnButtonInitialize(object sender, TreeListCommandColumnButtonEventArgs e)
{
if (e.NodeKey != null)
{
TreeListNode node = this.Tree_Gooslist.FindNodeByKeyValue(e.NodeKey.ToString());
if (node.ChildNodes.Count > )
{ e.Visible = DevExpress.Utils.DefaultBoolean.False; } } } //只删除父节点旁的新增、修改、删除操作
protected void Tree_Gooslist_CommandColumnButtonInitialize(object sender, TreeListCommandColumnButtonEventArgs e)
{
if (e.NodeKey != null)
{
TreeListNode node = this.Tree_Gooslist.FindNodeByKeyValue(e.NodeKey.ToString());
if (node.Level == )
{ e.Visible = DevExpress.Utils.DefaultBoolean.False; } } } //前端代码: <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="" 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="" 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>

ASPxTreeList控件去根节点的新增修改操作(写在onCommandColumnButtonInitialize()事件中)的更多相关文章

  1. DevExpress ASP.NET 使用经验谈(7)-ASPxTreeList控件使用

    这一节,将介绍ASPxTreeList控件的使用,首先,我们增加一个标准地址库表AddressGB, 建表语句如下: CREATE TABLE [dbo].[AddressGB]( [Code] [v ...

  2. 给C#的treeview控件的部分节点添加checkbox

    一.先初始化treeview this.treeView1.CheckBoxes = true; this.treeView1.ShowLines = false; this.treeView1.Dr ...

  3. Element ui tree树形控件获取当前节点id和父节点id

    低版本Element ui tree树形控件获取当前节点id和父节点id的方法:点击查看 最新版本Element ui tree树形控件获取当前节点id和父节点id教程: 1.找到node_modul ...

  4. element-ui tree控件获取当前节点和父节点

    今天使用element-ui 遇到两个问题,第一个问题是获取tree控件的当前节点和父节点, 一开始使用tree控件的getCurrentNode()函数,结果发现返回的是当前节点的data属性,和u ...

  5. C# LIstbox 解决WinForm下ListBox控件“设置DataSource属性后无法修改项集合”的问题

    解决WinForm下ListBox控件“设置DataSource属性后无法修改项集合”的问题 分类: winform2008-05-24 02:33 2592人阅读 评论(11) 收藏 举报 winf ...

  6. .net 控件开发第二天 怎么将 第一天写的代码 用到 .net中来

    前面第一天 我们看到的全是 js的代码,虽然不管是BS的框架是java 还是 php,复用性 还是特别高的,  但是 写起来比较费劲,怎么办,我们能不能 更 简单点呢? 当然可以,这个时候我们就要用到 ...

  7. 035——VUE中表单控件处理之使用vue控制select操作文字栏目列表

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  8. 解决WinForm下ListBox控件“设置DataSource属性后无法修改项集合”

    解决WinForm下ListBox控件“设置DataSource属性后无法修改项集合” 最近更新: 2013-2-15    587   很少写WinForm程序第一次使用ListBox控件就遇到了比 ...

  9. devexpress中如何绑定ASPxTreeList控件

    效果图: //前端控件代码: <dx:ASPxTreeList ID="Tree_Gooslist" AutoGenerateColumns="False" ...

随机推荐

  1. SVN:通过Client端打tag

    教你如何使用svnClient打tag~给公司人用的! 1.进入代码主目录 2.右击空白处“TortoiseSVN”—->“Branch/tag” 3.点地址栏右侧的 (选择tags存放目录) ...

  2. 【转】SQL SERVER DateTime类型的精度

    先看下边的SQL 语句 CREATE TABLE #DateTest( Id INT, SampleDate DATETIME ) INSERT INTO #DateTest VALUES(1,'1 ...

  3. Coding 初级教程(一)——用GitHub的GUI客户端对Coding的项目进行管理

    一.概述 二.Git基本概念 1.有关存储的四个概念 2.分支(branch) 三.项目管理实战操作 1.安装 GHfW(GitHub for Windows) 2.在Coding上新建一个项目(新建 ...

  4. git同步开发更新至项目目录(转载)

    From:http://toroid.org/ams/git-website-howto 本地版本库中存放开发的项目代码.以下内容介绍如何将本地版本库修改通过执行“git push web”命令同步到 ...

  5. java中通过位运算实现多个状态的判断

    通过 <<  |  & ~ 位运算,实现同时拥有多个状态 通过 << 定义数据的状态 public interface LogConstants { /** * 消耗标 ...

  6. UIView阴影和圆角的关系

    UIView阴影和圆角的关系   UIView 的 clipsToBounds属性和CALayer的setMasksToBounds属性表达的意思是一致的. 取值:BOOL(YES/NO) 作用:决定 ...

  7. 每个程序员都需要学习 JavaScript 的7个理由

    最近在和招聘经理交流现在找一个好的程序员有多难的时候,我渐渐意识到了现在编程语言越来越倾重于JavaScript.Web开发人员尤其如此.所以,如果你是一个程序员,那么你应该去学习JavaScript ...

  8. ruby关于flip-flop理解上一个注意点

    (..).each do |x| puts x ) .. (x == ) end 上面的flip-flop的用法,你可以理解成 将 大于等于5和小于等于10的数字打印出来,也就是理解成  puts x ...

  9. 第十章 Vim程序编辑器学习(下)

    在试用vim编辑时,vim会在于被编辑的档案的目录下,再建立一个名为****.swp的档案,如果你的系统因为某些原因断线,你编辑的档案还没有存储,这个时候的****.swp就能够挥发救援的功能 1.在 ...

  10. [ActionScript3.0] 运用JPEGEncoderOptions或者PNGEncoderOptions保存图片到本地

    在flash player 11.3和air3.3之前,我们可以借助第三方类(JPEGEncoder)这些,很容易处理.现在,有了encode和JPEGEncoderOptions这些,处理位图数据就 ...