Solved

Dynamic Sort Repeater

Posted on 2007-12-01
1
594 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
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

840 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