Label Integration
This help article illustrates how to integrate RadCheckBox with RadLabel, ASP:Label and HTML Label element.
RadLabel Integration
Instead of setting the Text
property of RadCheckBox to configure the text that appears after the checkbox, you can use RadLabel for this purpose. This would let you use the embedded functionality of RadLabel like marks, custom HTML and skinning.
To integrate RadCheckBox with RadLabel you should simply set the AssociatedControlID
property of the label control to the ID of the checkbox control it will be attached to (Example 1).
Example 1: RadLabel can be integrated with RadCheckBox.
<telerik:RadCheckBox runat="server" ID="RadCheckBox1" Checked="true">
</telerik:RadCheckBox>
<telerik:RadLabel runat="server" ID="RadLabel1" AssociatedControlID="RadCheckBox1" Text="RadLabel">
</telerik:RadLabel>
ASP:Label Integration
To integrate RadCheckBox with ASP:Label you should simply set the AssociatedControlID
property of the label control to the ID of the checkbox control it will be attached to (Example 2).
Example 2: ASP:Label can be integrated with RadCheckBox.
<telerik:RadCheckBox ID="RadCheckBox2" runat="server" Checked="true">
</telerik:RadCheckBox>
<asp:Label ID="Label1" runat="server" Text="aspLabel" AssociatedControlID="RadCheckBox2" />
HTML Label Integration
To integrate RadCheckBox with HTML Label you should simply set the for attribute of the label control to the ID of the checkbox control it will be attached to (Example 2).
Example 3: HTML Label can be integrated with RadCheckBox.
<telerik:RadCheckBox ID="RadCheckBox3" runat="server" Checked="true">
</telerik:RadCheckBox>
<label for="RadCheckBox3">HTML Label</label>