I have custom web part, there is ucSitemap control (inherites GoogleSitemap). In SetupControl i assign properties to ucSiteMap and then call ucSiteMap.ReloadData(true) ... ucSiteMap.SiteName = SiteName; ucSiteMap.WhereCondition = WhereCondition; ucSiteMap.ReloadData(true);
... ucSiteMap.SiteName = SiteName; ucSiteMap.WhereCondition = WhereCondition; ucSiteMap.ReloadData(true);
after this i delete some rows from ucSiteMap.DataSource and call ucSiteMap.DataSource.AcceptChanges(); foreach (DataRow row in ucSiteMap.DataSource.Tables[0].Rows) { if (condition_here) { row.Delete(); } } ucSiteMap.DataSource.AcceptChanges();
foreach (DataRow row in ucSiteMap.DataSource.Tables[0].Rows) { if (condition_here) { row.Delete(); } } ucSiteMap.DataSource.AcceptChanges();
but deleted records are still on the page. How can i delete records from ucSiteMap.DataSource and reflect these changes on the page?
looks like you are deleting the data after the binding. Did you try to reverse these pieces of code?
Peter Mogilnitski what do you mean under "try to reverse these pieces of code"? I can't go through datasource until i load data to it.
Did you try reloading after you delete?
ucSiteMap.ReloadData(true);
Please, sign in to be able to submit a new answer.