This is a migrated thread and some comments may be shown as answers.

"object reference not set to instance of an object" ContexMenu Error

2 Answers 36 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Ben Turpin
Top achievements
Rank 1
Ben Turpin asked on 08 Aug 2008, 03:04 PM
Hello.

I created a context menu from the radreeview properties. When I create a new ContextMenu and click in  Items to add new items it works fine, but after a while (I don't know when exactly) when I try to access the Items properties of the MenuContext a visual studio message box appears with this message: "Object neference not set to an Isntance of an object".

I didn't touch the aspx markup:
    <telerik:RadTreeView ID="RadTreeView1" Runat="server"  
        LoadingStatusPosition="BeforeNodeText"  
        onclientcontextmenushowing="OnContextShowing"
        <contextmenus> 
            <telerik:RadTreeViewContextMenu ID="MenuContextMenu" runat="server"  
                Flow="Horizontal"
                <expandanimation type="OutQuart" /> 
                <defaultgroupsettings expanddirection="Auto" flow="Vertical" /> 
                <collapseanimation duration="200" type="OutQuint" /> 
                <Items> 
                    <telerik:RadMenuItem runat="server" ExpandMode="ClientSide" Text="Add "  
                        Value="add"
                        <groupsettings expanddirection="Auto" flow="Vertical" /> 
                    </telerik:RadMenuItem> 
                    <telerik:RadMenuItem runat="server" ExpandMode="ClientSide" Text="Delete "  
                        Value="delete"
                        <groupsettings expanddirection="Auto" flow="Vertical" /> 
                    </telerik:RadMenuItem> 
                </Items> 
            </telerik:RadTreeViewContextMenu> 
        </contextmenus> 
        <Nodes> 
            <telerik:RadTreeNode runat="server" ExpandMode="ClientSide"  
                Text="Context Menu Test" Value="1"
            </telerik:RadTreeNode> 
        </Nodes> 
        <CollapseAnimation Type="OutQuint" Duration="100"></CollapseAnimation> 
 
        <ExpandAnimation Type="OutQuart" Duration="100"></ExpandAnimation> 
    </telerik:RadTreeView> 

The project runs fine even when I modify the markup manually, it might be a VS interaction issue. Any ideas?

2 Answers, 1 is accepted

Sort by
0
Erjan Gavalji
Telerik team
answered on 11 Aug 2008, 05:29 AM
Hi Ben,

This seems like a glitch in the RadTreeViewContextMenu designer. Can you elaborate a bit finding the exact steps to reproduce the problem and report them to us?

Kind regards,
Erjan Gavalji
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Paul
Top achievements
Rank 1
answered on 19 Nov 2008, 04:44 PM

Hello,

I'm experiencing the same. I have also noticed that the list of the context menus on the left hand side lists both of the context menus I have created as RadTreeViewContextMenu and not the IDs that I have assigned to the contextmenus.

Renaming the IDs back to RadTreeViewContextMenu1 and RadTreeViewContextMenu2 does not make a difference.

I do have two treeview controls on the page if that makes a difference.

I am using VWD2008 Express.

Thanks

Paul

Tags
TreeView
Asked by
Ben Turpin
Top achievements
Rank 1
Answers by
Erjan Gavalji
Telerik team
Paul
Top achievements
Rank 1
Share this question
or