Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7611205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:36:41+00:00 2026-05-31T01:36:41+00:00

I have a repeater control in which i am showing values from database and

  • 0

I have a repeater control in which i am showing values from database and i need to do sorting using a link button

Here is my code

<div class="demo">
<ul id="sortable1" class="connectedSortable" style="border-style: groove; border-width: inherit;border-color: #D4D0C8; height: 100%; width: 170px;">
<asp:LinkButton ID="LinkButton2" runat="server" onclick="LinkButton2_Click"   >LinkButton</asp:LinkButton>&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Repeater ID="rpt1" runat="server" DataSourceID="sqlDataSource1">
<ItemTemplate>
<li class="ui-state-default" >
<%# DataBinder.Eval(Container.DataItem, "code") %>
&nbsp;&nbsp;
<%# DataBinder.Eval(Container.DataItem, "regon_name") %>
</li>
</ItemTemplate>
</asp:Repeater>
</ul>
</div>

and

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DB_CGTPO_DEVEConnectionString %>"
SelectCommand="SELECT * FROM [region_test] ORDER BY [code], [regon_name]"></asp:SqlDataSource>

Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T01:36:43+00:00Added an answer on May 31, 2026 at 1:36 am

    rapidly, you could add an event in these likn buttons and change the select command, something like this:

    public void LinkButton2_Click(object sender, EventArgs e) 
    {
       //set the new select command with a ordery by
       SqlDataSource1.SelectCommand = "SELECT * FROM [region_test] ORDER BY [regon_name]";
    
       //refresh the repeater
       rpt1.DataBind();
    }
    

    Yo can add an event for every button and apply the order by command!
    This link shows a nice way to do it as well with repeaters (using ViewState to save the state of order by):
    http://weblogs.asp.net/sushilasb/archive/2004/10/09/240110.aspx

    []s

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a repeater control outputting some HTML. I want a table which outputs
Greetings! I have a Repeater control that's using an XmlDataSource control. <asp:FormView id=myFormView runat=server
I have an mxml panel in which I'm using a repeater. The panel can
I have a custom control which contains a Repeater control. The Repeater has an
I am developing a web application where I have a repeater control. A link
I have a Repeater control which contains a CheckBox and a lable control in
In my webform I have a repeater control. I have a button to open
I have the following repeater control, which is bound to collection of DashboardPage objects.
I have a user control in which I have Repeater control and inside this
Inside my Content page I have a repeater control, which contains multiple controls along

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.