SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to return TreeView from WCF Service ? Its giving error when we set return type as TreeView

share|improve this question
Can you please add more details, like your current code and the error message you get to this post? – Robert Lindgren Mar 26 '15 at 10:00

List of valid WCF return types

  • Primitive types (string, int32, etc...)
  • Complex types with DataContract or Serializable attributes
  • Stream
  • Message
  • SyndicationFeedFormatter
  • Void

There is no return type like TreeView. maximum you can get the xml out of WCF service and bind it to TreeView control.

share|improve this answer

Your Answer


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.