473,326 Members | 2,255 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

sorting datalist in ASP.Net?

LRW
Is it possible?
Here's the opening block of my datalist in the ASPX page,
and I was wondering if there's a way to sort the output by
a particular field:
<asp:datalist ID="dgProducts" runat="server"
Width="100%" Border="0"
HorizontalAlign="Left" EditItemStyle-
HorizontalAlign="left" ItemStyle-HorizontalAlign="left"
CssClass="text" CellPadding="4" CellSpacing="4"
RepeatDirection = "Vertical"
RepeatColumns="3" >
<ItemTemplate>

I've tried doing it at the dataview with a line:
dvContent.Sort = "PRD_ID ASC"
but that didn't change anything.

Thanks for any suggestions!
Liam

Jul 21 '05 #1
1 6696
Don't know if this will help but, that sort equation should work, but you do
have to be careful of values as strings vs numbers. (You may need to add a
column with datatype system.int32 values to your table to sort it properly.)
Also, I think the sort string is case sensative so make sure you match the
column values in your table.

"LRW" <dr***@NOSPAHMcelticbear.com> wrote in message
news:0e****************************@phx.gbl...
Is it possible?
Here's the opening block of my datalist in the ASPX page,
and I was wondering if there's a way to sort the output by
a particular field:
<asp:datalist ID="dgProducts" runat="server"
Width="100%" Border="0"
HorizontalAlign="Left" EditItemStyle-
HorizontalAlign="left" ItemStyle-HorizontalAlign="left"
CssClass="text" CellPadding="4" CellSpacing="4"
RepeatDirection = "Vertical"
RepeatColumns="3" >
<ItemTemplate>

I've tried doing it at the dataview with a line:
dvContent.Sort = "PRD_ID ASC"
but that didn't change anything.

Thanks for any suggestions!
Liam

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Eph0nk | last post by:
Hi, I have two small questions concerning databounding an xml file to a datalist. 1. Can i do (ascending/descending) sorting on a certain field? 2. Is it possible to show onliy the first 5...
0
by: Paul Turley | last post by:
I have a DataList control bound to a DataSet containing two tables. How do I sort the parent table without losing my relation? If I bind the DataList to a DataView, it's no longer relational...
1
by: Haydn Williams | last post by:
Hi, I have a load of records in a datalist, where RepeatColumns=3. The records are sorted by a particular field, and the sort order runs down the first column, then jumps to the top of the second...
2
by: Dufus | last post by:
Hi, I am working with a DataList and am binding objects to it. I normally use IList or other collections that implement the IEnumerable interface. I have a datalist that I need to be able to...
3
by: Brian Barnes | last post by:
Hi, I know this has been done quite often before, but all my research and trials have not worked. Basically I am trying to display a sorted list of e-mail Addresses in a datalist control (using...
1
by: LRW | last post by:
Is it possible? Here's the opening block of my datalist in the ASPX page, and I was wondering if there's a way to sort the output by a particular field: <asp:datalist ID="dgProducts"...
0
by: LisaBigJax | last post by:
I'm using VWD2.0 and VB I'm working with a Datalist (which doesn't have built-in sorting like the Gridview) and I would like to sort the datalist via dropdown list. In the...
3
by: Mirek Endys | last post by:
I have DataList as part of DataList item. DataList in DataList. The parent DataList working well including Edit command, that shows Edit template and correctly bind the data into edit template...
0
by: Maran | last post by:
We have come across a situation that I thinks not many have. Grateful for all responses. Regards Maran ************* * Scenario A DataList binds to a DataRow, with "RegionName" och...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.