I found a few questions similar to this one here on SO, but none that matched this problem, so here we go.
I've got a DataGridView showing members of a team. All the team members have an assigned role within the team listed in one of the columns. Examples could something like be "Legal Representative", "Account Manager", "Assistant Account Manager" or "Accountant".
Now here's where it gets interesting. I basically want to sort the grid on this column alphabetically, with a couple of exceptions. The "Account Manager" should always be listed at the top, followed by the "Assistant Account Manager" if there is one.
The objects and grid are all operational at this point, and have been in production release for some time, so I don't want to do more work on this than strictly necessary.
Is there an easy way to do this? I assume I have to do it programatically...
Some pseudo-code to clarify:
if (memberRole == 'Account Manager')
{
//put in top row
}
else if (memberRole == 'Assistant Account Manager')
{
//put in second row
}
else
{
//sort remaining rows alphabetically
}
I do my work in C# .NET using Visual Studio 2008.