<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tag 'Sort'</title><link>http://forums.asp.net/search/SearchResults.aspx?q=&amp;tag=Sort&amp;orTags=0&amp;o=DateDescending</link><description>Search results matching tag 'Sort'</description><dc:language>en-US</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Narrowing Dropdownlist contents</title><link>http://forums.asp.net/thread/3500877.aspx</link><pubDate>Sun, 08 Nov 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3500877</guid><dc:creator>aneasytorememberid</dc:creator><description>&lt;p&gt;I have a dropdownlist which is databound to a DB call depending on other form parameters. I need to have a textbox with a narrrow button which will take the user to a partial match in the dropdownlist. For eg. If the user enters &amp;quot;Joh&amp;quot; the dropdownlist should go to the first selected name with &amp;quot;joh&amp;quot;.&amp;nbsp; How do I do this?&lt;br /&gt;&lt;/p&gt;</description></item><item><title>The best way to sort xml and bind it</title><link>http://forums.asp.net/thread/3294634.aspx</link><pubDate>Wed, 15 Jul 2009 04:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3294634</guid><dc:creator>pierremesso</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m having trouble finding out the best way for my solution. Here&amp;#39;s what I want to do:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Read an XML containing books with&amp;nbsp;info. I then want to sort that xml. Finally I want to present the result somehow, maybe bind it to a repeater or something and beside each book title I want to have a checkbox.&lt;/p&gt;
&lt;p&gt;Only the Title for the books will be visible in the presentation but I need to store all the information about each checked book in a database when the client submits the form.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve tried several ways but I can&amp;#39;t get it all together. Anyone that have a guideline for the best way to solve this?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Pierre&lt;/p&gt;</description></item><item><title>How to Sort custom data inside GridView TemplateField?</title><link>http://forums.asp.net/thread/3162056.aspx</link><pubDate>Thu, 14 May 2009 04:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3162056</guid><dc:creator>MinimalTech</dc:creator><description>&lt;p&gt;&amp;nbsp;Hello there!&lt;/p&gt;&lt;p&gt;I have a problem with my GridView Control. In my aspx page, i have a &lt;b&gt;GridView1&lt;/b&gt; with columns:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre class="coloredcode"&gt;&amp;lt;asp:BoundField DataField=&amp;quot;Name&amp;quot; HeaderText=&amp;quot;Name&amp;quot; SortExpression=&amp;quot;Name&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;&lt;span class="tag"&gt;asp:TemplateField&lt;/span&gt;&lt;span class="attr"&gt; HeaderText=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;CustomWord&amp;quot;&lt;/span&gt;&amp;gt;    &lt;br /&gt;	&amp;lt;&lt;span class="tag"&gt;ItemTemplate&lt;/span&gt;&amp;gt;&lt;br /&gt;		&amp;lt;&lt;span class="tag"&gt;asp:Label&lt;/span&gt;&lt;span class="attr"&gt; ID=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;lblWord&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; runat=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;server&amp;quot;&lt;/span&gt; Text=&amp;quot;&amp;quot;&amp;gt;&amp;lt;/&lt;span class="tag"&gt;asp:Label&lt;/span&gt;&amp;gt;&lt;br /&gt;	&amp;lt;/&lt;span class="tag"&gt;ItemTemplate&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;span class="tag"&gt;asp:TemplateField&lt;/span&gt;&amp;gt;&lt;/pre&gt;&amp;nbsp;&lt;br /&gt;&lt;p&gt;The &amp;#39;Name&amp;#39; column gets the data from the GridView1&amp;#39;s SqlDataSource. Sorting is working well at that point.&lt;/p&gt;&lt;p&gt;BUT,&lt;/p&gt;&lt;p&gt;The &amp;#39;lblWord&amp;#39; label of the &amp;#39;CustomWord&amp;#39; column, gets the data from the custom-made function &amp;#39;makeWord()&amp;#39; in the GridView1_RowDataBound() Event.&lt;/p&gt;&lt;p&gt;The &amp;#39;makeWord()&amp;#39; function generates a string by adding and reading different variables....&lt;/p&gt;&lt;p&gt;HOW can i enable sort for the &amp;#39;CustomWord&amp;#39; column? The GridView1&amp;#39;s SqlDataSource does not have any relationship with &amp;#39;makeWord()&amp;#39; function...&lt;/p&gt;&lt;p&gt;The &amp;#39;makeWord()&amp;#39; function does not includes any DataSource....&lt;/p&gt;&lt;p&gt;Please, help! I have read a lot of articles inside and outside of forums.asp.net but i can&amp;#39;t find the answer...&lt;br /&gt;&lt;/p&gt;</description></item><item><title>how to sort record by date</title><link>http://forums.asp.net/thread/2953761.aspx</link><pubDate>Thu, 19 Feb 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2953761</guid><dc:creator>indianmaestro</dc:creator><description>&lt;p&gt;Hi friend,&lt;/p&gt;
&lt;p&gt;I would like to sort my records by Date and fill then in datagrid. while adding them i am converting the date format to&amp;nbsp; &lt;font size="2"&gt;System.&lt;/font&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;DateTime&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Now.ToString(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;dd/MM/yyyy HH:mm&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;); &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;but when i am selecting the record with this query &lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;
&lt;p&gt;strquery = &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;select * from Clients &lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;order by date desc&amp;quot;&amp;nbsp; the records r sorted by date but notby month , becoze the date is fiest and monthe is second and year is third in the Sql server data base.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;how can i get the record sorted by month. I want the latest record&amp;nbsp;first &lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/font&gt;</description></item><item><title>How to do 2 sorts in the same arraylist.</title><link>http://forums.asp.net/thread/2912380.aspx</link><pubDate>Tue, 03 Feb 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2912380</guid><dc:creator>PascalCmoa</dc:creator><description>&lt;p&gt;&amp;nbsp;Hi every body&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I created a class to sort an arraylist that i used to bind a GridView. In this case i have no problems, in this case i sort my arraylist with the id_user. &lt;/p&gt;&lt;p&gt;But i don&amp;#39;t know how sort this same arraylist with id_user and date, in fact i want te realized a sort with the id_user in the first sort and after with the date, 2 sorts in my arraylist. But i don&amp;#39;t know how to do that.&lt;/p&gt;&lt;p&gt;&amp;nbsp;You may see my class below:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre class="coloredcode"&gt;&lt;span class="kwd"&gt;Public Class&lt;/span&gt; trieur&lt;br /&gt;    &lt;span class="kwd"&gt;Public Function Compare&lt;/span&gt;(&lt;span class="kwd"&gt;ByVal&lt;/span&gt; x &lt;span class="kwd"&gt;As Object&lt;/span&gt;, &lt;span class="kwd"&gt;ByVal&lt;/span&gt; y &lt;span class="kwd"&gt;As Object&lt;/span&gt;) &lt;span class="kwd"&gt;As Integer Implements&lt;/span&gt; System.Collections.IComparer.&lt;span class="kwd"&gt;Compare&lt;br /&gt;        Dim&lt;/span&gt; valeurX &lt;span class="kwd"&gt;As&lt;/span&gt; modif = &lt;span class="kwd"&gt;CType&lt;/span&gt;(x, modif)&lt;br /&gt;        &lt;span class="kwd"&gt;Dim&lt;/span&gt; valeurY &lt;span class="kwd"&gt;As&lt;/span&gt; modif = &lt;span class="kwd"&gt;CType&lt;/span&gt;(y, modif)&lt;br /&gt;        &lt;span class="kwd"&gt;Select Case&lt;/span&gt; valeurX.id_User- valeurY.id_User&lt;br /&gt;            &lt;span class="kwd"&gt;Case Is&lt;/span&gt; &amp;gt; 0&lt;br /&gt;                &lt;span class="kwd"&gt;Return&lt;/span&gt; 1&lt;br /&gt;            &lt;span class="kwd"&gt;Case Is&lt;/span&gt; = 0&lt;br /&gt;                &lt;span class="kwd"&gt;Return&lt;/span&gt; 0&lt;br /&gt;            &lt;span class="kwd"&gt;Case Else&lt;br /&gt;                Return&lt;/span&gt; -1&lt;br /&gt;        &lt;span class="kwd"&gt;End Select&lt;br /&gt;&lt;br /&gt;    End Function&lt;br /&gt;End Class&lt;/span&gt;&lt;/pre&gt;&amp;nbsp;&amp;nbsp;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Dynamic Data Entity Framework: Initial Sort Order</title><link>http://forums.asp.net/thread/2875251.aspx</link><pubDate>Sun, 18 Jan 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2875251</guid><dc:creator>BHunsaker</dc:creator><description>&lt;p&gt;Dynamic Data 3.5 SP1&lt;br /&gt;&lt;/p&gt;&lt;p&gt;For just one of my Dynamic Data Entities tables I would like to control the order of the displayed records, specifically I would like to order a date column descending.&lt;/p&gt;&lt;p&gt;The (SQL Server) table is named &amp;quot;EventLog&amp;quot; with a column &amp;quot;datLocalTimestamp&amp;quot; of type DateTime.&lt;/p&gt;&lt;p&gt;In my &amp;quot;meta&amp;quot; .cs file, I have tried adding the following:&lt;/p&gt;&amp;nbsp;&lt;pre class="coloredcode"&gt;[MetadataType(&lt;span class="kwd"&gt;typeof&lt;/span&gt;(EventLogMetaData)), DisplayColumn(&lt;span class="st"&gt;&amp;quot;datLocalTimestamp&amp;quot;&lt;/span&gt;, &lt;span class="st"&gt;&amp;quot;datLocalTimestamp&amp;quot;&lt;/span&gt;, &lt;span class="kwd"&gt;true&lt;/span&gt;)]&lt;br /&gt;&lt;br /&gt;&lt;span class="kwd"&gt;public&lt;/span&gt; partial &lt;span class="kwd"&gt;class&lt;/span&gt; EventLog&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&amp;nbsp;&lt;br /&gt;&lt;p&gt;This did nothing.&amp;nbsp; Next, I tried adding a IComparer class:&lt;/p&gt;&amp;nbsp;&lt;pre class="coloredcode"&gt;&lt;span class="kwd"&gt;internal class&lt;/span&gt; EventLogCompare : IComparer&amp;lt;EventLog&amp;gt;&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;    &lt;span class="kwd"&gt;public int&lt;/span&gt; Compare( EventLog logA, EventLog logB )&lt;br /&gt;&lt;br /&gt;    {&lt;br /&gt;&lt;br /&gt;        &lt;span class="kwd"&gt;return&lt;/span&gt; DateTime.Compare( logB.datLocalTimestamp, logA.datLocalTimestamp);&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;I put a breakpoint on the Compare method but it is never invoked.&lt;/p&gt;&lt;p&gt;Do I need to modify the Page_Load event in the ListDetails.aspx.cs page template file?&amp;nbsp; That doesn&amp;#39;t seem like the way to go for a single table...&lt;/p&gt;&lt;p&gt;Thanks for your help. &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Default sorting with descending order</title><link>http://forums.asp.net/thread/2765926.aspx</link><pubDate>Tue, 25 Nov 2008 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2765926</guid><dc:creator>Balyk</dc:creator><description>I have some table with Date column. I want to have default sorting on my Date column with descending order that rows with last date wil be on the top.

I have a LINQ to SQL DataSource. I have attempted to use OrderByParameters, but I can&amp;#39;t make descending order on my column.

Which the best way to resolve my problem? May be there is some way in Dynamic Data framework not in DataSource. How can I intercept creating Select command to database?</description></item><item><title>Setting initial sort order</title><link>http://forums.asp.net/thread/2567166.aspx</link><pubDate>Tue, 19 Aug 2008 04:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2567166</guid><dc:creator>smhontz</dc:creator><description>&lt;p&gt;I&amp;#39;m using Dynamic Data 3.5 SP1.&amp;nbsp; I have two questions on setting the initial sort order for Gridviews displaying data from the LINQ data source.&lt;/p&gt;&lt;p&gt;1. Is there a way to impose my own sort order on the table gridviews that dynamic data is automatically generating?&amp;nbsp; Is there some attribute I can set in the partial class, or do I have to make a custom page?&lt;/p&gt;&lt;p&gt;2. I have some stored procedures that I dragged into the ORM designer.&amp;nbsp; I created a new page, put a gridview for each procedure on it (it&amp;#39;s a summary page, designed to show just a few rows from selected tables.)&amp;nbsp; In the code-behind, I set the Page_Load code like this:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;MyDataContext dc = new MyDataContext();&lt;/p&gt;&lt;p&gt;FirstGridview.DataSource = dc.spMyFirstProc();&lt;/p&gt;&lt;p&gt;FirstGridView.DataBind();&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Is there some way for me to force the sort order of the grid view here, too? &amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;Are these more LINQ questions, rather than Dynamic Data?&amp;nbsp; I&amp;#39;m pretty new to both. &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: File Object</title><link>http://forums.asp.net/thread/2565163.aspx</link><pubDate>Mon, 18 Aug 2008 04:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2565163</guid><dc:creator>igor.p</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Yes, the code as you have it will not work.&amp;nbsp; You need to sort the collection before you write the information.&amp;nbsp; You can create a custom Comparer (by implementing IComparer interface -- see &lt;a href="http://msdn.microsoft.com/en-us/library/system.collections.icomparer.aspx"&gt;http://msdn.microsoft.com/en-us/library/system.collections.icomparer.aspx&lt;/a&gt;), add the items to an ArrayList, sort it and then render the file information.&lt;/p&gt;
&lt;p&gt;I have a question for you.&amp;nbsp; How come you&amp;#39;re using Server.CreateObject?&lt;/p&gt;
&lt;p&gt;I hope this helps.&lt;/p&gt;</description></item><item><title>How to sort the gridview with custom queries</title><link>http://forums.asp.net/thread/2548599.aspx</link><pubDate>Sun, 10 Aug 2008 04:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2548599</guid><dc:creator>Sal</dc:creator><description>&lt;p&gt;I have a gridview databound to an access database. I am allowing users to select the individual letters of the alphabet with individual&amp;nbsp;link buttons (A,B,C...) (I know, this is not the best way to do this but it&amp;#39;s what I have for now.) to return the employees whose last name starts with that particular letter. The problem is when I attempt to sort the names, the gridview goes blank. Other than that , the thing works fine.&amp;nbsp;From my understanding, when doing any sorting the page does a post back so I&amp;#39;m thinking the select statment goes blank or null when the postback occurs. Does anybody have any suggestions on how to solve this? Some ideas I have which may not be correct or possible are:&amp;nbsp; &lt;/p&gt;
&lt;p&gt;1.) retrieve the last query, (but how?)&lt;br /&gt;2.) bind the returned data to the gridview (but how?)&lt;br /&gt;3.) will viewstate do it?&lt;br /&gt;4.) some other .net framework feature work?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Sal&lt;/p&gt;</description></item></channel></rss>