We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Complex Grouping Sorting

Thread ID:

Created:

Updated:

Platform:

Replies:

47095 Jul 27,2006 05:21 PM Jul 30,2006 12:53 PM Windows Forms 3
loading
Tags: Grouping
Martin Nitschke
Asked On July 27, 2006 05:21 PM

I have attached a sample of data, one desired result and a picture of the layout. What I am asking to do is to not only group/sort, but maybe change the order of sorting for the next group.

The sample suggests I am planning a delivery route for two cities and four zip codes, 3 streets in those cities. I would like to be able to sort my Grouping Grid, then number each row for the sequence so I know which houses to deliver. (see map center and bottom layout)

Not every city has the same layout, this is just for demo purposes. Let''s say each city has Main Street running north to south and when travelling east or west from Main, the house numbers increase (see map). I want to drive down first street all the way from My City to Other City and drop off packages at each house. Then I want to drive up Second Street back to My City.

However, if I were to only sort by First Street, then number, I would not have the correct sequence, because the house numbers first decrease, then increase, decrease, then increase.

What I need to do is resort the house numbers when the zipcode changes. The spreadsheet attached should show better than I can explain in words. Can the GroupingEngine handle this type of sorting/grouping? Is there sample code available?

GroupingSort.zip

Administrator [Syncfusion]
Replied On July 29, 2006 05:43 AM

Let me confirm that I understand what you want.

The records in your data have these fields:
City (eg MyCity)
Zip (eg 99999)
Street (eg Third)
Address(eg 321)

You then want to sort these records using a sort key based on these four fields. You want to see these records ordered by City+Zip+Street+Address but with the Address alternating between ascending and descending order based on the value of City+Zip+Street.

If so, I think this would be doable using either an unbound column or a custom sort. If the above is what you want, I think we can work up a sample showing how you might do it. The unbound column idea is straight forward. (It can be hidden so it is not seen.) You make the value in the unbound column something that will sort City+Zip+Street in a normal manner (some kind of weighted sum that can uniquely position these 3 fields in their proper order when sorted). But when you tweak the value to include Address, you look at City+Zip+Street to decide what the value is to make it sort Address either ascending or decending varying with City+Zip+Street.

Administrator [Syncfusion]
Replied On July 29, 2006 07:15 PM

Here is a sample that I think does what you described.

http://www.syncfusion.com/Support/user/uploads/GGC_SpecialSort_a4485444.zip

Martin Nitschke
Replied On July 30, 2006 12:53 PM

Yes, that is basically what we want. However, it does become a little more complicated because the sort keys may be in any order. I just wanted to get an idea to get pointed in the right direction. I will check the sample. Thanks!

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;