M
MarkusJNZ
Hi, I have a dataview which I am using to bind to a gridview.
In the page load event I am checking for a condition in each row of
the dataview and if it exists I want to remove the row from the
dataview before I bind it to the gridview;
Pseudo code below
================
DataView people = ExecuteDataSet.Tables[0].DefaultView;
for(int nloop = 0; nloop<people.Count; nloop++)
{
if(people[nloop]["Age"] < 18)
{
// Remove the currrent row from the DataView
}
}
================
I have tried
people.Table.Rows.RemoveAt(nloop);
people.AcceptChanges();
but this does not seem to work
Any help appreciated!
Thanks
Markus
In the page load event I am checking for a condition in each row of
the dataview and if it exists I want to remove the row from the
dataview before I bind it to the gridview;
Pseudo code below
================
DataView people = ExecuteDataSet.Tables[0].DefaultView;
for(int nloop = 0; nloop<people.Count; nloop++)
{
if(people[nloop]["Age"] < 18)
{
// Remove the currrent row from the DataView
}
}
================
I have tried
people.Table.Rows.RemoveAt(nloop);
people.AcceptChanges();
but this does not seem to work
Any help appreciated!
Thanks
Markus