M
matt
hello,
so the DataView object is confusing me. i have a dataset of a bunch of
rows, some of white my page needs to filter out before binding. no
problem, i make a new dataview, set a filter and then bind the dv to my
page. ala:
DataView myDV = New DataView(myDS.Tables[0], "Show=1", "ID DESC",
DataViewRowState.CurrentRows);
myRepeater.DataSource = myDV;
....this is cool and it only shows what its supposed to.
however, what confuses me is... when i try to get the first row of my
filtered view, i do this:
someLabel.Text = myDV.Table.Rows[0][0];
....i am getting a row that was filtered out! (the first row happens to
be one i dont want to show). i had thought the DataView was a new
collection of criteria-matching rows. whaaa? guess not.
so i have two questions:
1) how does a DataList/Grid/whatever know to exclude binding filtered
out items
2) how can i call up a single item from *only* the list of
criteria-matching rows?
thanks!
matt
so the DataView object is confusing me. i have a dataset of a bunch of
rows, some of white my page needs to filter out before binding. no
problem, i make a new dataview, set a filter and then bind the dv to my
page. ala:
DataView myDV = New DataView(myDS.Tables[0], "Show=1", "ID DESC",
DataViewRowState.CurrentRows);
myRepeater.DataSource = myDV;
....this is cool and it only shows what its supposed to.
however, what confuses me is... when i try to get the first row of my
filtered view, i do this:
someLabel.Text = myDV.Table.Rows[0][0];
....i am getting a row that was filtered out! (the first row happens to
be one i dont want to show). i had thought the DataView was a new
collection of criteria-matching rows. whaaa? guess not.
so i have two questions:
1) how does a DataList/Grid/whatever know to exclude binding filtered
out items
2) how can i call up a single item from *only* the list of
criteria-matching rows?
thanks!
matt