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

So I have this line: lvwp.ListViewXml.OrderBy.. - after this I have no Idea what to write?

I would like to assign something like:

Combining like this:

lvwp.ListViewXml.OrderBy<FieldRef Name='Index' Ascending='TRUE' />(); 

will ofcourse not work

I have looked at: http://msdn.microsoft.com/en-us/library/system.linq.enumerable.orderby.aspx , but I just dont get it, Im pretty new with programming and dont really understand concepts like Enumerable and generics

Anyway, is there a simple answer to this?

share|improve this question
add comment

1 Answer

ListViewXml is of type string, so you should not use Linq at all on it.

It should be set with a string containing CAML

Something like this:

lvwp.ListViewXml = "<Query><Where>YOUR FILTER CAML IF NEEDED</Where><OrderBy><FieldRef Name='Index' Ascending='TRUE' /></OrderBy><Query>"
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.