Welcome Guest Search | Active Topics | Sign In | Register

How to conditionally remove the menu items from slide menu Options
Viren
Posted: Sunday, October 21, 2007 10:04:53 PM
Rank: Member
Groups: Member

Joined: 10/9/2007
Posts: 18
Hi,
I am trying to bind data using an SitemapDatasource and Sitemap Provider. I want to remove menu items conditionally from the control.

When I try to do this in itemDatabound function, I am getting an error "Object reference not set to an instance of an object. "

The Remove statement was like this:

If (e.NavigationItem.Level = 0) Then
mnuSlide.Items.Remove(e.NavigationItem)
End if

Kindly, Let me know how to remove menu items.

Regards,
Viren
eo_support
Posted: Monday, October 22, 2007 6:07:02 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,088
Hi Viren,

You can't do that while you are data binding. Try set the item's Visible to false instead.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.