Re: dataview sort problem
- From: "Marina Levit [MVP]" <someone@xxxxxxxxxx>
- Date: Tue, 19 Sep 2006 15:59:48 -0400
The rows never physically get sorted. The view provides a sorted view of the
data. The table never changes. You have to access the data through the view
to see it sorted. Going to the table itself does nothing - no reason to
create the view in the first place.
This is why you can have multiple views on one table. Otherwise, which one
would win?
"Jim" <keithjd@xxxxxxxxx> wrote in message
news:1158695140.346936.70610@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have a dataview that I'm trying to apply a sort to, but when I
iterate through the rows in the dataview, they are still in the
original order. Here's my code. I'm using an XML document to populate
my DataSet
DataView dvProject = new DataView(MyDS.Tables["Project"], "FY = 2008",
"FY ASC", DataViewRowState.None);
// dvProject.Sort = "FY ASC, Quarter ASC";
Console.WriteLine("{0}", dvProject.Sort);
foreach (DataRow _Project in dvProject.Table.Rows)
{
Console.WriteLine("{0}{1}", _Project["FY"], _Project["Quarter"]);
}
Should be fairly straight-forward right?? I even tried to put on a
rowfilter with no luck. Anyone have any ideas? thx --jim
.
- References:
- dataview sort problem
- From: Jim
- dataview sort problem
- Prev by Date: dataview sort problem
- Next by Date: Re: dataview sort problem
- Previous by thread: dataview sort problem
- Next by thread: Re: dataview sort problem
- Index(es):
Relevant Pages
|