I have the following block of code that retrieves a document node in kentico and deletes it. It does delete the kentico node, but not the underlying document type which stays in the datase. Help?!
CMS.TreeEngine.TreeProvider provider = new CMS.TreeEngine.TreeProvider(CMS.CMSHelper.CMSContext.CurrentUser);
CMS.TreeEngine.TreeNode image = provider.SelectSingleNode(new Guid(imageID), "en-US", CMS.CMSHelper.CMSContext.CurrentSite.SiteName);
if (image != null)
{
CMS.TreeEngine.TreeNode school = provider.SelectSingleNode(image.Parent.NodeID, "en-US", true, true);
if (school != null)
{
string CMSUserID = school.GetValue("CMSUserID").ToString();
if (CMSUserID == ui.UserID.ToString())
{
image.Delete(false);
}
}
}