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 ?
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
NodeLevel, NodeOrder, NodeName
customRepeater.orderBy="NodeID DESC" or customRepeater.orderBy="NodeID ASC"
customRepeater.orderBy="NodeID DESC"
customRepeater.orderBy="NodeID ASC"
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.
customRepeater.ReloadData(true);
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
Please, sign in to be able to submit a new answer.