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>

最新文章

  1. USB Host的上拉下拉电阻
  2. 【原创】开源Math.NET基础数学类库使用(15)C#计算矩阵行列式
  3. Redis 64 steps
  4. MyBatis调用存储过程,含有返回结果集、return参数和output参数
  5. JMeter学习-018-JMeter 配置元件之-HTTP信息头管理器-实现 Cookie 登录
  6. 自定义 SqlHelp
  7. oracle ebs request一直pending
  8. Android facebook-android-sdk-3.5.2 FQL
  9. Careercup - Facebook面试题 - 5110993575215104
  10. Linux系统上安装软件(ftp服务器)
  11. jQuery组件写法
  12. ckfinder 1
  13. Mac下Sublime Text 3安装配置
  14. Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks(理解)
  15. 图解Windows 10下Visual Studio Code的下载和安装
  16. 如何生成git ssh key
  17. wheel
  18. 解决jupyter中无自己创建的虚拟环境
  19. Unity shader学习之屏幕后期处理效果之边缘检测
  20. JS(JQEERY) 获取JSON对象中的KEY VALUE

热门文章

  1. (二)java特征
  2. The tag &#39;ChartPlotter&#39; does not exist in XML namespace
  3. Oracle Erp常用网站
  4. BestCoder Round #85 hdu5777 domino
  5. NeHe OpenGL教程 第二十二课:凹凸映射
  6. JConsole connection failed
  7. 区分DPI、分辨率(PPI)、图像的物理大小、像素宽度
  8. ruby1.8到2.1语法改变
  9. [Flex] PopUpButton系列 —— 判断下拉列表是否选中
  10. java异常处理机制throws