Sorting a datagrid view by column NUMERICALLY,decending, progrmatically-vb 2005 expre


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Sorting a datagrid view by column NUMERICALLY,decending, progrmatically-vb 2005 expre

  1. #1
    Join Date
    Jul 2007
    Posts
    142

    Sorting a datagrid view by column NUMERICALLY,decending, progrmatically-vb 2005 expre

    Can you help me please?

    I have an unbound datagridview (DGV2) which I want to sort by

    the numeric value of column 2 in decending order so that "10"

    comes before "5". A normal descending sort treats them as

    strings and put "5" before "10".

    I would be grateful for any help.

    Thanks,

    Steve.

  2. #2
    Join Date
    Jul 2007
    Location
    Minnesota
    Posts
    155
    Why don't you make sure to change the column data type to number or integer.
    That will allow the sort to be proper.

  3. #3
    Join Date
    Jul 2007
    Posts
    142

    How do I do that?

    Thanks for the info, it sounds good. Unfortuately I am new to vb.net, how do I that?

    Thanks,

    Steve.

  4. #4
    Join Date
    Jul 2007
    Location
    Minnesota
    Posts
    155
    What database are you using?

    If it is access, then open the Access database and the table that is used in the query.
    You should then switch to Design view.
    By looking at the column, you can tell what data type it is.

    Usually, you will see (Text, Autonumber, Memo, etc)
    If the data column is Text then you may need to change that to Number.

    Does this help?

Similar Threads

  1. Help Please with sorting XML data in datagrid
    By Cab_0001 in forum ASP.NET
    Replies: 7
    Last Post: 01-18-2007, 09:33 PM
  2. vb datagrid show column selected by users
    By michelle in forum VB Classic
    Replies: 1
    Last Post: 06-28-2002, 09:22 AM
  3. They created J#, why couldn't they do VB#?
    By Thomas Eyde in forum .NET
    Replies: 290
    Last Post: 12-22-2001, 03:13 PM
  4. Re: Using sorting in VB Datagrid: -THanks
    By beth in forum VB Classic
    Replies: 0
    Last Post: 10-05-2001, 01:19 PM
  5. Using sorting in VB Datagrid: HOW??
    By Beth in forum VB Classic
    Replies: 1
    Last Post: 10-05-2001, 11:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center