Timeline for DataTable runtime grouping on user defined criteria
Current License: CC BY-SA 3.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 19, 2017 at 18:59 | vote | accept | t3chb0t | ||
| Jun 19, 2017 at 18:41 | comment | added | JanDotNet | Sounds good. Another option could be to create a class like ComposableKey, getting a list of objects with custom Equals / GetHashCode implemenation. That is probably more descriptive in usage but less flexible compared to a comparer. | |
| Jun 19, 2017 at 18:31 | comment | added | t3chb0t | Exactly, I've just tested it and it works great. Now I'm also able to add a proper hash-code for such a collection. | |
| Jun 19, 2017 at 18:29 | comment | added | JanDotNet | Do you mean something like .GroupBy(x => keyColumns.Select(key => x[key]).ToArray()) + custom comparer using SequenceEqual? | |
| Jun 19, 2017 at 18:13 | comment | added | t3chb0t | The column name for the group seems really to be a stupid idea... I'm wondering why did I think I need it. I'll throw it away but I'll have to keep the comparer and instead it'll use the SequenceEqual for two collections to determine if the keys are same because the columns can by of any type so it needs to use Equals internally. | |
| Jun 19, 2017 at 18:00 | history | answered | JanDotNet | CC BY-SA 3.0 |