Setting the checked property for deleting a document by default

   —   
This article describes how to set the checked property for deleting a document by default.
You are presented with a few options when deleting a document from the CMS Desk using the Delete button.  These options depend if you are deleting a document with a single culture, a document with multiple cultures, or a document with a product. Each one of these options is unchecked by default, but in some cases you may want these boxes checked by default. In each one of these cases, you will need to modify the file ~\CMSModules\Content\CMSDesk\Delete.aspx, and simply add Checked="True" property to the correct checkbox. 



 Let’s look at each example below:
 
Deleting a document with a single culture presents you with the option to Destroy document and its history (document cannot be restored)”.  This CheckBox ID is chkDestroy and is located on line 47:

<asp:CheckBox ID="chkDestroy" runat="server" CssClass="ContentCheckbox" Visible="false" EnableViewState="false"/>
 
Adding Checked="True” to this line will set the checked property by default for this option:

<asp:CheckBox ID="chkDestroy" runat="server" CssClass="ContentCheckbox" Visible="false" EnableViewState="false" Checked="True" />
 
Deleting a document with multiple cultures presents you with the option to Destroy document and its history (document cannot be restored)”, and the option toDelete all culture versions of the specified document”.  This CheckBox ID is chkAllCultures and is located on line 50:

<asp:CheckBox ID="chkAllCultures" runat="server" CssClass="ContentCheckbox" EnableViewState="false" />

Adding Checked="True” to this line will set the checked property by default for this option:

<asp:CheckBox ID="chkAllCultures" runat="server" CssClass="ContentCheckbox" EnableViewState="false" Checked="True" />

Deleting a document with a product presents you with the options of Destroy document and its history (document cannot be restored)”, and the option toDelete product of the specified document”.  This CheckBox ID is chkDeleteSKU and is located on line 54:

<asp:CheckBox ID="chkDeleteSKU" runat="server" CssClass="ContentCheckBox" Visible="false" />
 
Adding Checked="True” to this line will set the checked property by default for this option:
 
<asp:CheckBox ID="chkDeleteSKU" runat="server" CssClass="ContentCheckBox" Visible="false"  Checked="True” />
 
The screenshot below is an example of all the check boxes being enabled by default when deleting a document.
 

 
-eh-


Applies to: Kentico CMS 6.x
Share this article on   LinkedIn