Solved

sorting a datagrid

Posted on 2006-11-14
4
222 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
  • 2
4 Comments
 
LVL 1

Accepted Solution

by:
mjdeale earned 380 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 120 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

709 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now