Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

What's the best/easiest approach of getting the vertical top menu items in a Silverlight web part?

Is this possible with the client object model? As far as I can see this can only be used to retrieve data from lists?

I'm a SP beginner so please try to be clear :-)

share|improve this question
    
Have you implemented this and checked if this works ? –  Nikhil Feb 14 at 16:34
add comment

1 Answer

up vote 2 down vote accepted

I'm not a Silverlight expert, but it should be entirely possible to do what you want. The Client Object Model presents not only lists and list items, but also webs too - since these are what the navigation links are too, all the data you need can be obtained this way.

Effectively you would need to use the following approach:

  • Get a reference to the current site collection
  • Iterate/find each of the top-level webs you wish to use in navigation
  • For each, find the child webs according to how many levels deep you wish to go
  • Do the Silverlight bit to create menus from this data

Remember that SharePoint's navigation is quite optimized (caching etc.), and is also fairly configurable (e.g. how many levels deep, starting node, add authored links etc.). In a completely custom implementation, you'll need to establish how far you need to go. Code following the above pattern would be quite inefficient if written server-side with the SharePoint .Net API, but I think you might be OK because the Client OM will batch up the requests to the back-end.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.