Hello,
I am still investigating the behaviour of your treeview and I am in front of a new challenge.
I was using binding tags in your tree view and this was displaying the contect menu without any problem. But thenm, I had to customize a bit things and therefore had to use the custom item tag.
It works fine in the tree view databinding occurs , etc... but I can't have access to my context menu anymore . Is there any instruction that I am missing?
please have a look on my code :
for the tree view :
Code: HTML/ASPX
<eo:TreeView ID="C_EOTV_Category" runat="server" RaisesServerEvent="true"
DataSource=<%# CatalogItems.ToHierarchicalEnumerable(cat => cat.ID, cat => cat.ParentId) %>
ClientSideOnContextMenu="ShowContextMenu"
EnableViewState=true
>
<topgroup>
<Nodes>
<eo:TreeNode Text="test"></eo:TreeNode>
</Nodes>
<TemplateItem>
<CustomItem>
<img src="/Images/Dynamic/<%# ((CatalogItemProvider)Container.DataItem).Released %>.gif" />
<asp:LinkButton runat=server ID=C_Lbtn_Item CommandArgument="<%# ((CatalogItemProvider)Container.DataItem).ID %>" OnClick=Modify>
<%# ((CatalogItemProvider)Container.DataItem).Name %>
</asp:LinkButton>
</CustomItem>
<SubGroup>
<TemplateItem>
<CustomItem>
<img src="/Images/Dynamic/<%# ((CatalogItemProvider)Container.DataItem).Released %>.gif" />
<asp:LinkButton runat="server" ID="C_Lbtn_Item" CommandArgument="<%# ((CatalogItemProvider)Container.DataItem).ID %>"
OnClick="Modify">
<%# ((CatalogItemProvider)Container.DataItem).Name %>
</asp:LinkButton>
</CustomItem>
</TemplateItem>
</SubGroup>
</TemplateItem>
</topgroup>
<looknodes>
<eo:TreeNode ItemID="_Default"
HoverStyle-CssText="background-color:#cccccc;cursor:hand"
SelectedStyle-CssText="background-color:#cccccc"
ImageUrl="/dynamiq/images/system/folderClosed.gif"
CollapsedImageUrl="/dynamiq/images/system/folderClosed.gif"
ExpandedImageUrl="/dynamiq/images/system/folderOpen.gif" />
</looknodes>
</eo:TreeView>
and just after the context view associated with it:
Code: HTML/ASPX
<eo:ContextMenu ID="C_EOCM_Category" Width="144px" runat="server" ControlSkinID="None" >
<TopGroup Style-CssText="cursor:hand;font-family:Verdana;font-size:11px;">
<Items>
<eo:MenuItem Text-Html="(un)Release" >
</eo:MenuItem>
<eo:MenuItem Text-Html="Add Element">
</eo:MenuItem>
<eo:MenuItem Text-Html="Add Child Element">
</eo:MenuItem>
<eo:MenuItem Text-Html="Delete">
</eo:MenuItem>
</Items>
</TopGroup>
<LookItems>
<eo:MenuItem IsSeparator="True" ItemID="_Separator" NormalStyle-CssText="background-color:#E0E0E0;height:1px;width:1px;">
</eo:MenuItem>
<eo:MenuItem HoverStyle-CssText="color:#F7B00A;padding-left:5px;padding-right:5px;"
ItemID="_Default" NormalStyle-CssText="padding-left:5px;padding-right:5px;"
>
<SubMenu
ExpandEffect-Type="GlideTopToBottom"
Style-CssText="border-right: #e0e0e0 1px solid; padding-right: 3px; border-top: #e0e0e0 1px solid; padding-left: 3px; font-size: 12px; padding-bottom: 3px; border-left: #e0e0e0 1px solid; cursor: hand; color: #606060; padding-top: 3px; border-bottom: #e0e0e0 1px solid; font-family: arial; background-color: #f7f8f9"
CollapseEffect-Type="GlideTopToBottom" OffsetX="3" ShadowDepth="0" OffsetY="-4"
ItemSpacing="5">
</SubMenu>
</eo:MenuItem>
</LookItems>
</eo:ContextMenu>
Many thanks for helping me sorting this out,
Yoann
PS: By the way i am trying jsut now to use the drag and drop thing to reorder my tree view and I experiment the same kind of trouble..
I have added these to the decalration of my tree view:
Code: HTML/ASPX
AutoSelectSource="ItemClick" AllowDragDrop="True" AllowDragReordering="True"
OnItemMoved=ReOrderItem