ASPxTreeList的右键按钮事件

ASPxTreeList应该是比较长用的控件了~现在就来说说它的右键按钮事件

这里实现的是右键里有折合和展开所有节点的功能

code:

复制代码
 1 <dx:ASPxTreeList ID="ASPxTreeList2"  ClientInstanceName="treelist1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" Height="400px" KeyFieldName="id" ParentFieldName="parent_id" Width="200px" OnHtmlDataCellPrepared="ASPxTreeList2_HtmlDataCellPrepared" OnHtmlRowPrepared="ASPxTreeList2_HtmlRowPrepared">
<Columns> 3 <dx:TreeListTextColumn FieldName="child_id" Visible="False" VisibleIndex="0"> 4 </dx:TreeListTextColumn> 5 <dx:TreeListTextColumn Caption="后台管理" FieldName="name" VisibleIndex="1" Name="name"> 6 </dx:TreeListTextColumn> 7 <dx:TreeListTextColumn FieldName="id" Visible="False" VisibleIndex="2"> 8 </dx:TreeListTextColumn> 9 <dx:TreeListTextColumn FieldName="parent_id" Visible="False" VisibleIndex="3"> 10 </dx:TreeListTextColumn> 11 </Columns> 12 <Settings ShowTreeLines="False" /> 13 <SettingsBehavior AllowDragDrop="False" AllowFocusedNode="True" AllowSort="False" AutoExpandAllNodes="True" /> 14 <%--<Images SpriteImageUrl="/image/backgroud3.jpg"> 15 </Images>--%> 16 <SettingsCustomizationWindow Enabled="True" /> 17 <Images SpriteImageUrl="/image/backgroud1.jpg"> 18 </Images> 19 <ClientSideEvents ContextMenu="function(s, e) { 20 if(e.objectType == &quot;Node&quot;) 21 { 22 rightmenu.ShowAtPos(ASPxClientUtils.GetEventX(e.htmlEvent), 23 ASPxClientUtils.GetEventY(e.htmlEvent)); 24 } 25 }" /> 26 <BackgroundImage ImageUrl="/image/backgroud3.jpg" /> 27 28 </dx:ASPxTreeList>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值