473,326 Members | 2,124 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 a dataset displayed using a repeater

I am displaying a dataset using a Repeater. I would like to allow the user
to click on a column header and have the data sort by that column. How do I
go about this?

Does anyone know of any example code?

Many thanks.
Nov 19 '05 #1
4 1951
You will have to hand code this functionality, as there is no built in
mechanism, like the DataGrid.

To do so, the easiest method is link buttons in the header template that
have the field name and then resorting the DataTable in that order.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"Andrew Chalk" wrote:
I am displaying a dataset using a Repeater. I would like to allow the user
to click on a column header and have the data sort by that column. How do I
go about this?

Does anyone know of any example code?

Many thanks.

Nov 19 '05 #2
Andrew there ia an example here at:-
http://aspnet.4guysfromrolla.com/articles/020905-1.aspx
Hope that helps
Patrick

"Andrew Chalk" <ac****@magnacartasoftware.com> wrote in message
news:uY**************@TK2MSFTNGP15.phx.gbl...
I am displaying a dataset using a Repeater. I would like to allow the user
to click on a column header and have the data sort by that column. How do I go about this?

Does anyone know of any example code?

Many thanks.

Nov 19 '05 #3
Thanks. In that case can I get the advantage of Repeater (in this case
formatting of the data in each column) in a datagrid?

Andrew

"Cowboy (Gregory A. Beamer) - MVP" <No************@comcast.netNoSpamM> wrote
in message news:95**********************************@microsof t.com...
You will have to hand code this functionality, as there is no built in
mechanism, like the DataGrid.

To do so, the easiest method is link buttons in the header template that
have the field name and then resorting the DataTable in that order.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"Andrew Chalk" wrote:
I am displaying a dataset using a Repeater. I would like to allow the
user
to click on a column header and have the data sort by that column. How do
I
go about this?

Does anyone know of any example code?

Many thanks.

Nov 19 '05 #4
Thanks, I'll take a look.

Andrew
"Patrick.O.Ige" <pa********@optusnet.com.au> wrote in message
news:Ot**************@TK2MSFTNGP15.phx.gbl...
Andrew there ia an example here at:-
http://aspnet.4guysfromrolla.com/articles/020905-1.aspx
Hope that helps
Patrick

"Andrew Chalk" <ac****@magnacartasoftware.com> wrote in message
news:uY**************@TK2MSFTNGP15.phx.gbl...
I am displaying a dataset using a Repeater. I would like to allow the
user
to click on a column header and have the data sort by that column. How do

I
go about this?

Does anyone know of any example code?

Many thanks.


Nov 19 '05 #5

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

Similar topics

4
by: suzy | last post by:
hello. how can i sort data in a dataset? all the examples i have seen on msdn, etc are sorting a dataview. this works fine, but i want to return the results in xml and the dataview doesn't...
3
by: Ben Becker | last post by:
I am trying to build a custom crosstab type of grid where I take some items in a data grid and based on the content of the current item compared to the previous item, determine if a new row in a...
2
by: Viktor Popov | last post by:
Hi, I'd like to asky you if it could be accomplished sorting with repeater by column? If yes would you give me an example or link to find out? Thanks! Viktor --- Outgoing mail is...
0
by: mando | last post by:
Hello, I have a repeater to which a dataset was bound. During an ItemCommand event I sorted the dataset and bound it back to the repeater's datasource but I get a runtime error. The error...
1
by: news.microsoft.com | last post by:
<asp:Repeater id="rptCourseDetail2" runat="server" datasource='<%# ((DataRowView)Container.DataItem).Row.GetChildRows("CourseDetailRelation") %>' EnableViewState="false" > I am having...
8
by: Matthew Curiale | last post by:
I am creating an app that lists clients of a company for management of different attributes for that company. The first page is a listing of the companies currently in the database. I have my...
4
by: TJS | last post by:
Any examples or tips on how to add sorting to a repeater column header ?
0
by: Chris Botha | last post by:
Using VS2005, on the form is a DataGridView, a typed DataSet containing the data and a BindingSource between the grid and the dataset. One of the columns is a DataGridViewComboBoxColumn, doing what...
4
by: Brad Baker | last post by:
I'm going a little crazy :) I'm trying to bind a repeater control to a dataset on page load using the following code: if (Request.QueryString != null) { string customerid = Request.QueryString;...
0
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.