.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Order by choice field options in order of appearance

Posted By:      Posted Date: September 02, 2010    Points: 0   Category :SharePoint
I have a list, which has a choice field with a number of options (e.g. Spring, Summer, Autumn, Winter). These options appear in this order in the drop down list, but when I sort the list by this field, the items are sorted alphabetically, is there a way to change it easily, so that the list is ordered by the choice field and the items appear in the same order as the choice options? I am trying to do this programatically using the SPQuery, but any other solution would be welcome too. I am displaying the data using SPGridView control.

View Complete Post

More Related Resource Links

dynamic template field order


I have the following example with adds a dynamic template field to my gridview.  However its being added at index = 0.

I need it at the end of the gridview, which has columns determined by user entry, so they will not always be the same amount of columns.

How do I get this template field to be the last column in my gridview.  I have already tried    columns.Insert(index, mycolname) and I get an "out of range" error message


  Protected Sub rtrv_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles rtrv.Click
        Dim bldvw As base, ds As DataTable, dc As DataColumn
 bldvw = New base

        ds = bldvw.bldDynGrd(srCtr.Text, srActiv.Text, srAcct.Text)

        If ds IsNot DBNull.Value Then
            For Each dc In ds.Columns
                Dim bField As New BoundField
                'Initalize the DataField value.



Is it possible with SQL sorted in descending order according to the word?
In Table I shrajeno Mastercard, Visa, Diners etc ...

All Visa are the first in the order, another Mastercard, etc. ...

Something does not work: ORDER BY PaymentType = 'Visa';

I would not want to work in one field PaymentId (111,222,33, etc. ..) and then use the ORDER BY.

Is this possible in such a way?

Linq qry with order by basic questions


I have never tried a group by with linq, now I do and I'm stuck.

I try to convert this sql statement to its linq counterpart :

SELECT COUNT(tb_Mailer_Smses.Id) AS [cnt], tb_Mailer_mailing.Id As [Id]
,SUM( CASE WHEN tb_Mailer_smses.DLRStatus = 200 THEN 1 ELSE 0 END) As [Delivered]
FROM tb_Mailer_mailing INNER JOIN
tb_Mailer_Smses ON tb_Mailer_mailing.Id = tb_Mailer_Smses.MailingId
WHERE tb_Mailer_mailing.ApplicationId = 1
GROUP BY tb_Mailer_mailing.Id

Is there some one who can me show me the convertion process ?

ASP.NET: Collect Customer Order Information on an Internet Site Using XML and Web Forms


XML has quickly become the new data structure standard for everything from database access to cross-platform computing. XML is typically considered to be a vehicle for data exchange, dynamic data presentation, and data storage. However, the potential of XML far surpasses those limited applications. This article examines one new use: the gathering of data across a number of forms in an ASP.NET Beta 1 framework application. The sample program is a Web app used for ordering pizza. It uses ASP and C# to gather order information and then stores it in XML. To build the application, several concepts are explained, including data collection, order persistence using cookies, grouping input forms, and formatting the data for display.

Jeff Jorczak

MSDN Magazine September 2001

order by in combination with union


 Hi All,

How can I order this by count? so if it appears above and below the union statement, I want it on top

	SELECT distinct BIER.Naam, BIER_L2.L2_Naam, BIER_L3.L3_Naam from BIER_MATCH, BIER, BIER_L2, BIER_L3

	SELECT distinct BIER.Naam, BIER_L2.L2_Naam, BIER_L3.L3_Naam from BIER_MATCH, BIER, BIER_L2, BIER_L3
	where BIER_L2.L2_ID = BIER.L2_ID and BIER_L2.L3_ID = BIER_L3.L3_ID and RECEPT_ID = @RECEPT_ID 
	and BIER_MATCH.BIER_ID is null


Is it possible to filter KPI list in order to display only relevant KPIs


I  have created a KPI list and I want to show sections of the list on various parts of my site, however, I dont seem to be able to filter the list. Has anyone tried this and had any success?

Order by Nemeric column


Hi all,

Thank you for advance.

the Document Rank column is numeric and contain the values are 2,1,0,4,0,5,3,0,6

we need to get the document rank with the following orders

how can i do this?

http module calling order


Our site uses urlRewriter http module that does the url rewriting for us.

I want to create another http module that will handle our customize URL redirects. Now I want this new customize http module to be call before the UrlRewriter module (to avoid page not found messages the UrlRewriter generates). Is there a way we can contol the calling order ?

how to get current loop order number in "for each" ?

For Each item As pages.tbl1Row In pagesdim x as integerx = ?????response.write("current loop is :" & x )               Nextwhat code i need to replace with "?????" to get current loop order?

SSIS Changing Column Order during Transformation

First let me say, I really can't believe this chain of events myself--and they are happening to me. I am upgrading several DTS packages to SSIS on what will be my new production server.  These packages create tables, export them to a flat file, and ftp them off to other locations. What is happening (on the SSIS side) is that the OLE DB Source is reordering some of the columns on its own (moving them to the end of the table/file.  Then when my pickup/load routines run, the data is out of place and they fail. Can anyone please explain what is happening here with the mapping.  I have evaluated the table and the columns are in the order that I expect.  When I preview the source table in the OLE DB Source Editor the columns are in the correct order/alignment, but when them in the OLE DB Source Editor --Columns section within BIDS the order is changed arbitrarily. I have been somewhat successful (2 out of 3) in being able to re-map the data, but this last table just doesn't want to change.  Thanks in advance for any help and/or information you can provide

Pie Chart - possible to order the slices?

Is it possible to order the slices in a Reporting Services 2008 pie chart, so that they are in order of magnitude (size) from largest to smallest?   Thanks, Chris

Looking for TSQL statement that returns customers with greatest number of order in descending order

What would be an efficient TSQL SELECT statement that joins customer and order tables, counts the orders for each customer (group by) and returns a result for all customers with at least one order, and also in descending order from customers with the most orders to the least?
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend