Solved

Dynamic Sort Repeater

Posted on 2007-12-01
1
599 Views
Last Modified: 2008-02-14
I am using a repeater control to format results from an MS SQL Table.  I would like to place some combination of dropdowns on the page to compose the sort order.  Then click a button to refresh the sort order as specified.  How do I update the selectcommand to change and update the ORDER BY.  OR if there is a better way to approach this, that would also be helpful.  (using the repeater is motivated by the resulting format I need to display)  Thank You
0
Comment
Question by:reinsmms
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 12

Accepted Solution

by:
needo_jee earned 250 total points
ID: 20387718
In click event of Button (the one using to update repeater with newly selected order) .. change the Select command text with newly created QueryText with values from DropDownlists used for Order selection.

If you are using SqlDataSource then here is the way.
SqlDataSource1.SelectCommand= "SELECT COL1, COL2,COL3 FROM myTable where myTestID='" + Session["Userid"] + " Order by " + dropdownOrderBy.SelectedValue + ";

The above code tells how to update Query .. it is example not a working code sample.

Thanks
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question