Forum Moderators: open

Message Too Old, No Replies

DataView sort doesn't update Repeater (ASP.NET)

         

flite

12:33 pm on May 25, 2004 (gmt 0)

10+ Year Member



This is a ASP.NET problem.

A have a Repeater with a DataView bound to it. Works fine. I've added LinkButtons to the headers of the data columns for choosing sort order. When clicking a LinkButton, the corresponding click-method sets the sort order of the DataView. The problem is the data back on the web page isn't sorted.

I've tried to make a new DataView (with the new sort order) and had this bound to the Repeater with the same results.

Anyone got any ideas how to solve this?

Jimmy Turnip

3:05 pm on May 25, 2004 (gmt 0)

10+ Year Member



Have you checked the order the code is executing? Sometimes you find a Page_Load event or an On_Click event that's rebounding the control.

flite

6:23 am on May 26, 2004 (gmt 0)

10+ Year Member



Seems like I swapped a couple of rows. A rebind after the sort command is all it takes.

dv.Sort = "ID";
Repeater1.DataBind();