I am having a problem grouping by a certain column and ordering by a different column. When I group by a column it puts them in alphabetical order. I want the rows in a different order. For example...
I'm using XML similar to this to populate the gridview...
<?xml version="1.0" encoding="UTF-8"?> |
<RootElement xmlns:mstns="http://tempuri.org/RootElement.xsd"> |
<System> |
<ID>681F04EF-80CD-47FE-AC8C-5DC497E2BDCD</ID> |
<Name>String</Name> |
<Owner>String</Owner> |
<Services>String</Services> |
<SystemType>Beta</SystemType> |
<OrderNum>1</OrderNum> |
<DateLastModified>2001-12-17T09:30:47.0Z</DateLastModified> |
</System> |
<System> |
<ID>CCA76E63-B4B5-4AA4-A5BD-E8A1D83A0C91</ID> |
<Name>String</Name> |
<Owner>String</Owner> |
<Services>String</Services> |
<SystemType>Zeta</SystemType> |
<OrderNum>2</OrderNum> |
<DateLastModified>2001-12-17T09:30:47.0Z</DateLastModified> |
</System> |
<System> |
<ID>CCA76E63-B4B5-4AA4-A5BD-E8A1D83A0C91</ID> |
<Name>String</Name> |
<Owner>String</Owner> |
<Services>String</Services> |
<SystemType>Alpha</SystemType> |
<OrderNum>3</OrderNum> |
<DateLastModified>2001-12-17T09:30:47.0Z</DateLastModified> |
</System> |
<System> |
<ID>CCA76E63-B4B5-4AA4-A5BD-E8A1D83A0C91</ID> |
<Name>String</Name> |
<Owner>String</Owner> |
<Services>String</Services> |
<SystemType>Kappa</SystemType> |
<OrderNum>4</OrderNum> |
<DateLastModified>2001-12-17T09:30:47.0Z</DateLastModified> |
</System> |
</RootElement> |
I'm using the OrderNum as a way to determine which order I want them showing up in the gridview. So I want to see the list like this...
Beta
(All of the rows that fall into the Beta group)
Zeta
(All of the rows that fall into the Zeta group)
Alpha
(All of the rows that fall into the Alpha group)
Kappa
(All of the rows that fall into the Kappa group)
If I don't use OrderNum at all I get...
Alpha
(All of the rows that fall into the Alpha group)
Beta
(All of the rows that fall into the Beta group)
Kappa
(All of the rows that fall into the Kappa group)
Zeta
(All of the rows that fall into the Zeta group)
Obviously it's defaulting to alphabetical order.
If I use "OrderNum format '{1}. ', SystemType format '{1}' Group By OrderNum I get
1.
(All of the rows that fall into the Beta group)
2.
(All of the rows that fall into the Zeta group)
etc...
I want to see
1. Beta
(All of the rows that fall into the Beta group)
2. Zeta
(All of the rows that fall into the Zeta group)
etc...
or
Beta
(All of the rows that fall into the Beta group)
Zeta
(All of the rows that fall into the Zeta group)
etc...
Sorry for the length, but I wanted to make sure you all had all the information you might need to help me out.
Thanks in advance.