How can I sort a column in a DataGrid?

Let’s learn how can I sort a column in a DataGrid. The most accurate or helpful solution is served by Stack Overflow.

There are ten answers to this question.

Best solution

How to sort DataGrid column

I have a datagrid that contains data that retrived from a database, and the datagrid displays data in the same format as in the database. One of the columns is DateFrom which is the column I would like to sort. Dateform stored in the database as Varchar, therefore is sorted alphabetically,for example 2/2004, 2/2008, 4/2003. I want to convert DatFrom to typ DateTime, and sort the values numerically before display in the datagrid. Is there any way to do it? Thanks Aein


Probably wrap the column to implement the IComparable interface so you can provide a custom sort, here...

Read more

aein at Stack Overflow Mark as irrelevant Undo

Other solutions


Is there a code which will automatically sort 3 columns alphabetically so when I need to add a procedure, I don’t have to manually reorganize the procedure names alphabetically? This option is only for me to load into the page and not for users...


There's nothing in HTML to do it. You could easily implement it in php (server-side) or javascript ...

Read more

Melissa at Yahoo! Answers Mark as irrelevant Undo

Sort rows with data too long for a column

I have a spreadsheet of 5,000 text records. One column needs to have a maximum number of characters. Some data in this column exceeds the maximum. I would like to separate the rows that have data that is too long for this column. Is there a formula I...


Brenda assume the next available column if column G in G2 put in the formula =if(len(B2)>250,...

Read more Mark as irrelevant Undo

How do i add a button column to a datagrid in a c# .net windows application?(NOT an application)?

the gatagrids source is a dataset and i need the column to allow the user to update the info in the table


I've learned that reinventing the well is not really the best solution. I've tried this solution and...

Read more

se at Yahoo! Answers Mark as irrelevant Undo

Sort multiple columns in Excel without sorting column headers?

This seems like it should be so straightforward that I shouldn't even have to ask, but I can't find a way to make this happen. I need my columns to have informative headers (not A,B,C,D). I also need to sort many columns by another column, so I have...


The Sort routines in Excel have an option to select whether your data has header rows or not. For Excel...

Read more

Geoff B at Yahoo! Answers Mark as irrelevant Undo

If you sort data in a spreadsheet, by clicking in the column you want to sort on?

and clicking the sort A to Z button, then none of the associated information in the rows will get sorted with it. True or False


XL will ask if you want to extend the range. If you decline then your question is False, if you accept...

Read more

Juju at Yahoo! Answers Mark as irrelevant Undo

In Excel, how can I sort whole columns rather than rows in the column?

Let's say I have 8 columns with the headings; USD EUR AUD CHF GBP KRW SEK TRL and in each column, there are many rows of data. I would like to sort the columns alphabetically to become; AUD CHF EUR GBP KRW SEK TRL USD I cannot manually do that because...


To sort columns in alphabetical order... -Select all the columns. -From the Excel menu, select Data...

Read more

DeepBlue at Yahoo! Answers Mark as irrelevant Undo

Custom sort on second sort field

QUESTION: I have three columns of data that need to be sorted. The first column is a list of names which needs to be sorted in ascending alphabetical order. The second column is an ID number to be sorted in ascending numeric order. The third column contains...


I can't advise you on the the Dataoption arguments because they are specific to your data and what you...

Read more Mark as irrelevant Undo

Sort macro to run on most but not all worksheets

QUESTION: I am using2007 and would like to have a macro that automatically runs when I open a workbook to sort the information based on the values entered into column E. Most of the worksheets are sorting based on the values in column E but I have a...


Amy Under formulas, define name; enter a range name like database or amy or something. Under Refers...

Read more Mark as irrelevant Undo

Excel?? Some duplicate word in column sorting remedy

I trade the stock market..I use a charting systen that i can load hundreds of stock symbols into(for reveiwing my charts) column form.(single column) Here's what I need and why. There is a need for me to add and delete stock symbols weekly.I can...


benbowpro... If I understand your query correctly, there is such a utility, created by Jacob Hilderbrand...

Read more

benbowpro-ga at Google Answers Mark as irrelevant Undo

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.