ASPxTreeList控件去根节点的新增修改操作(写在onCommandColumnButtonInitialize()事件中)
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()事件中)的更多相关文章
- DevExpress ASP.NET 使用经验谈(7)-ASPxTreeList控件使用
这一节,将介绍ASPxTreeList控件的使用,首先,我们增加一个标准地址库表AddressGB, 建表语句如下: CREATE TABLE [dbo].[AddressGB]( [Code] [v ...
- 给C#的treeview控件的部分节点添加checkbox
一.先初始化treeview this.treeView1.CheckBoxes = true; this.treeView1.ShowLines = false; this.treeView1.Dr ...
- Element ui tree树形控件获取当前节点id和父节点id
低版本Element ui tree树形控件获取当前节点id和父节点id的方法:点击查看 最新版本Element ui tree树形控件获取当前节点id和父节点id教程: 1.找到node_modul ...
- element-ui tree控件获取当前节点和父节点
今天使用element-ui 遇到两个问题,第一个问题是获取tree控件的当前节点和父节点, 一开始使用tree控件的getCurrentNode()函数,结果发现返回的是当前节点的data属性,和u ...
- C# LIstbox 解决WinForm下ListBox控件“设置DataSource属性后无法修改项集合”的问题
解决WinForm下ListBox控件“设置DataSource属性后无法修改项集合”的问题 分类: winform2008-05-24 02:33 2592人阅读 评论(11) 收藏 举报 winf ...
- .net 控件开发第二天 怎么将 第一天写的代码 用到 .net中来
前面第一天 我们看到的全是 js的代码,虽然不管是BS的框架是java 还是 php,复用性 还是特别高的, 但是 写起来比较费劲,怎么办,我们能不能 更 简单点呢? 当然可以,这个时候我们就要用到 ...
- 035——VUE中表单控件处理之使用vue控制select操作文字栏目列表
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- 解决WinForm下ListBox控件“设置DataSource属性后无法修改项集合”
解决WinForm下ListBox控件“设置DataSource属性后无法修改项集合” 最近更新: 2013-2-15 587 很少写WinForm程序第一次使用ListBox控件就遇到了比 ...
- devexpress中如何绑定ASPxTreeList控件
效果图: //前端控件代码: <dx:ASPxTreeList ID="Tree_Gooslist" AutoGenerateColumns="False" ...
随机推荐
- 【转】图片IMG标记的alt属性和title属性的使用
alt text 替 换文字(alt text)是为了给那些不能看到你文档中图像的浏览者提供文字说明.这包括那些使用本来就不支持图像显示或者图像显示被关闭的浏览器的用户,视觉障碍的用户和使用屏幕阅读器 ...
- ajax实现--技术细节详解
ajax原理和XmlHttpRequest对象 Ajax的原理简单来说通过XmlHttpRequest对象来向服务器发异步请求,从服务器获得数据,然后用javascript来操作DOM而更新页面.这其 ...
- SOA_环境安装系列4_Oracle SOA安装和环境搭建(案例)
2015-01-02 Created By BaoXinjian
- Report_客制化报表输出Excel后去0问题(案例)
2014-02-01 Created By BaoXinjian
- cf 61 E. Enemy is weak 离散化+树状数组
题意: 给出一个数组,数组的每一个元素都是不一样的,求出对于3个数组下标 i, j, k such that i < j < k and ai > aj > ak where ...
- Existence and nonexistence results for anisotropic quasilinear elliptic equations
Fragalà, Ilaria; Gazzola, Filippo; Kawohl, Bernd. Existence and nonexistence results for anisotropic ...
- 转_ _android开发中如何结束所有的activity
每一个activity都有自己的生命周期,被打开了最终就要被关闭. 四种结束当前的activity方法 Java代码: //关闭当前activity方法一 finish(); //关闭当前界面方法 ...
- contentProvider 内容提供者
http://blog.csdn.net/woshixuye/article/details/8280879 实例代码当数据需要在应用程序间共享时,我们就可以利用ContentProvider为数据定 ...
- Java多线程之捕获异常
1.主线程不能捕获到子线程的异常 package Thread.Exection; import java.util.concurrent.ExecutorService; import java.u ...
- cursor详解
源地址:http://www.cnblogs.com/jiewoyishengwzm/archive/2010/06/08/1754232.html 查询 SELECT语句用于从数据库中查询数据,当在 ...