I'm trying to hack together a datagridview in c# that can handle hierarchical data (currently just 2 levels) since I couldn't find a 3rd-party control that worked and looked exactly as I needed it to.
I've managed to get expand/collapse and global sorting working (sort by top level group, then sort within each group) but I want to add a feature where you can sort just within a top level group. so imagine a 2-column example, e.g.
column1 | column2
group 1 | 6
group 1 a | 1
group 1 b | 2
group 1 c | 3
group 2 | 15
group 2 a | 4
group 2 b | 5
group 2 c | 6
I want the user to be able to double click the "15" cell, and have it sort just the "group 2 X" rows, with all other rows staying exactly where the are. each cell's tag tells it what it's parent is, so I know whether the given pair of rows are part of the same sub-group. I can't quite figure out the logic though. I tried setting SortResult = 0 for any pair of rows not in the same group, but I still have to handle cases where one row is in the subgroup and one isn't. any ideas?