Sorting a dataset displayed using a repeater

Discussion in 'ASP .Net' started by Andrew Chalk, Oct 24, 2005.

  1. Andrew Chalk

    Andrew Chalk Guest

    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.
     
    Andrew Chalk, Oct 24, 2005
    #1
    1. Advertising

  2. 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.
    >
    >
    >
     
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN, Oct 24, 2005
    #2
    1. Advertising

  3. Andrew there ia an example here at:-
    http://aspnet.4guysfromrolla.com/articles/020905-1.aspx
    Hope that helps
    Patrick

    "Andrew Chalk" <> wrote in message
    news:...
    > 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.
    >
    >
     
    Patrick.O.Ige, Oct 24, 2005
    #3
  4. Andrew Chalk

    Andrew Chalk Guest

    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" <> wrote
    in message news:...
    > 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.
    >>
    >>
    >>
     
    Andrew Chalk, Oct 24, 2005
    #4
  5. Andrew Chalk

    Andrew Chalk Guest

    Thanks, I'll take a look.

    Andrew
    "Patrick.O.Ige" <> wrote in message
    news:OtWWt$...
    > Andrew there ia an example here at:-
    > http://aspnet.4guysfromrolla.com/articles/020905-1.aspx
    > Hope that helps
    > Patrick
    >
    > "Andrew Chalk" <> wrote in message
    > news:...
    >> 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.
    >>
    >>

    >
    >
     
    Andrew Chalk, Oct 24, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jim French
    Replies:
    0
    Views:
    614
    Jim French
    Jul 18, 2003
  2. =?Utf-8?B?S2lt?=

    Data not displayed in Repeater

    =?Utf-8?B?S2lt?=, Dec 1, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    470
    =?Utf-8?B?S2lt?=
    Dec 6, 2005
  3. boney
    Replies:
    1
    Views:
    592
  4. Replies:
    1
    Views:
    192
  5. Andrew Chalk

    Sorting a dataset displayed using a repeater

    Andrew Chalk, Oct 24, 2005, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    152
    Andrew Chalk
    Oct 24, 2005
Loading...

Share This Page