Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

sorting a datagrid

Posted on 2006-11-14
4
Medium Priority
?
277 Views
Last Modified: 2010-04-23
Hello Experts,

I have a question related to sorting a data grid. The grid holds rows of an order. The last column of each row is a supplier row. What I want to do is sort the rows into sublists into a master list.

for example, if the order is as follows

row/ supplier
1) a
2) a
3) b
4) a
5) b

I create an array list holding 2 array lists, one for each distinct item in the grid (a and b). Here is where I run into trouble. I read the data for each column per row. How can I sort the row into the proper list during runtime? I need to have a master list that holds sub lists of each supplier.

Thanks,
Zac
0
Comment
Question by:sacul
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 1

Accepted Solution

by:
mjdeale earned 1520 total points
ID: 17939431
mydatagridview.Sort(datagridviewColumn, Direction(asc or Desc))
0
 
LVL 5

Expert Comment

by:DEEPESH
ID: 17939736
This is the perfect site, which tells you how to sort data on multiple columns,
as above mentioned problem can be solved by using sort on multiple columns
hope it will help you
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=677968&SiteID=1
0
 
LVL 5

Assisted Solution

by:DEEPESH
DEEPESH earned 480 total points
ID: 17939752
Dim view As DataView = DataTable1.DefaultView

    ' By default, the first column sorted ascending.
    view.Sort = "State, ZipCode DESC"
0
 
LVL 1

Author Comment

by:sacul
ID: 17943609
Hello,

Awesome, just plain awesome. mjdeale..you hit the nail right one the head and you will get the accepted answer....but I will split the points since the link that DEEPESH posted has alot of valuable information.

Thanks alot for the help. True experts indeed.

Zac
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

636 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