CMSReapter OrderBy not working

Mb _Krishna asked on February 17, 2017 12:41

I am using a CMSRepeater in widget code behind . <cms:CMSRepeater runat="server" ID="customRepeater" > I'm binding the data also in code behind and used customRepeater.orderBy="NodeID" and I'm sending dataset by NodeID order too, but the repeater is binding in it's own order. Is there any I can achieve order by from code behind ?

Correct Answer

Brenden Kehren answered on February 17, 2017 14:43

Have you verified the order of the items you are putting out? NodeID's are not a very valid way to sort IMHO because of the sporadic numbers you will receive. Better off using NodeLevel, NodeOrder, NodeName

0 votesVote for this answer Unmark Correct answer

Recent Answers


Peter Mogilnitski answered on February 17, 2017 13:30

customRepeater.orderBy="NodeID DESC" or customRepeater.orderBy="NodeID ASC"

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on February 17, 2017 14:57

If you're binding the data in the code behind, sometimes you need to call customRepeater.ReloadData(true); after to get it to rebind. But if it's rendering otherwise, Brenden's note on the order should do the trick.

0 votesVote for this answer Mark as a Correct answer

Chetan Sharma answered on February 17, 2017 17:05

Can you check the NodeId's of the response and validate it against those entries in the DB?

I agree with Brenden. It is not a conducive way. What is your requirement here?

BTW, NodeID will change from server to server.

Thanks, Chetan

2 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.