2.0 Object Data Source -Sort
Posted on 2006-05-31
1st. Is the new object data easier for you guys? Its new to me, so its making my head hurt. I feel like its harder to use then the 1.1 sa, ds, and dv. (In regards to doing custom binding. aka I change data as it comes down from the sql server.)
But anyways on to the question at hand.
So, like I stated - I change data as I pull it from the SQL Server. Example, some things come down as 71206 and I would change that to 7/12/2006.
Thats all fine and great. In 2.0, I approach this by pointing my object DS to a function that returns a typed data set. And that works great. It binds to a grid view and theres my data. Now heres where I have the problem. And I bet this is an easy one. How in the world do I call the sort routine on the data. I want a default sort on the data. In 1.1 I would just through a dv in there and it would be done. I can't do this at the SQL level, nor do I want to do it in the function as then I would return a dv and there would go all my nice UI for the databound items. I know the 2.0 control can sort as I can do it via the gv as the app is running, but how do I call it in the code behind? What am I missing. I want to use this data-sorted in a dropdownlist also, so sorting on the grid only would not work.