M
MattB
Hi, I have a dataset (vb.Net 1.1) that I need to go through and re-order
based on the data. I'm wondering if there is a nice relatively automated
way to do this, but I kind of doubt it. There is not currently a single
field to use in a DataView's order by parameter.
The data has two fields that decide the order, node_id and parent_id.
The parent_id is the node_id of the row above. If there is no
corresponding row to the parent_id then we have row 0.
I've messed around a little with looping through the table and I haven't
found any elegant (or even not ugly) solutions. Two options that come to
mind are cloning the table and copying the rows in order, probably
making multiple passes. Another would be to add an "order" column and
populating that as I loop through and then use a dataview to order the
rows according to that field.
Anyone got any better solutions? Could I create a recursive DataRelation
to do this? I'd love to hear any ideas!
Thanks!
Matt
based on the data. I'm wondering if there is a nice relatively automated
way to do this, but I kind of doubt it. There is not currently a single
field to use in a DataView's order by parameter.
The data has two fields that decide the order, node_id and parent_id.
The parent_id is the node_id of the row above. If there is no
corresponding row to the parent_id then we have row 0.
I've messed around a little with looping through the table and I haven't
found any elegant (or even not ugly) solutions. Two options that come to
mind are cloning the table and copying the rows in order, probably
making multiple passes. Another would be to add an "order" column and
populating that as I loop through and then use a dataview to order the
rows according to that field.
Anyone got any better solutions? Could I create a recursive DataRelation
to do this? I'd love to hear any ideas!
Thanks!
Matt