M
Markus Heid
Hi,
I've got following issue: I'm creating a dataset during runtime. The Dataset
is unsorted. It may look this way unsorted:
pk_id value1 value2 string3
1 1 10 10, 20
2 1 11 14
3 2 100 1
4 2 101 20, 10
5 2 102 11
6 3 70 1, 10, 20
7 3 1 9
sorted it should look that way:
3 2 100 1
7 3 1 9
5 2 102 11
2 1 11 14
1 1 10 10, 20
4 2 101 20, 10
6 3 70 1, 10, 20
As you see I want to sort the dataset by the length of the content of the
field "string3". My first attempt
was to do it with a dataview:
DataView myView = new DataView( myDataTable );
myView.Sort = "len(string3)";
But that throws an exception that the column "len(string3)" is unknown.
Does anyone here knows how to do such a thing
I'm thankfull for every hint
Markus
I've got following issue: I'm creating a dataset during runtime. The Dataset
is unsorted. It may look this way unsorted:
pk_id value1 value2 string3
1 1 10 10, 20
2 1 11 14
3 2 100 1
4 2 101 20, 10
5 2 102 11
6 3 70 1, 10, 20
7 3 1 9
sorted it should look that way:
3 2 100 1
7 3 1 9
5 2 102 11
2 1 11 14
1 1 10 10, 20
4 2 101 20, 10
6 3 70 1, 10, 20
As you see I want to sort the dataset by the length of the content of the
field "string3". My first attempt
was to do it with a dataview:
DataView myView = new DataView( myDataTable );
myView.Sort = "len(string3)";
But that throws an exception that the column "len(string3)" is unknown.
Does anyone here knows how to do such a thing
I'm thankfull for every hint
Markus