CheckBoxGroup Field Control

From Sense/Net Wiki
Jump to: navigation, search
  •  
  •  
  •  
  •  
  • 100%
  • 6.0
  • Enterprise
  • Community
  • Planned

Overview

The CheckBoxGroup Field Control displays a list of checkboxes for selecting an option from a single- or multiple-selection Choice field.

CheckBoxGroup Field Control

Details

When the underlying Choice Field is configured to allow extra value an extra textbox is rendered next to the dropdown control.

Supported Field types

Properties

  • SelectedValueType (optional): Sets the display type of the selected options in Browse mode. Possible values are Value and Text, default is Text.

Example:

   <sn:CheckBoxGroup ID="CheckBoxGroup1" runat="server" FieldName="Style" SelectedValueType="Value" />


For a complete list of common Field Control properties see common Field Control properties.

Templates

The CheckBoxGroup Field Control renders a Label control in Browse mode and a CheckBoxList accompanied with a TextBox - the latter for an optional extra value - in Edit mode.

Browse view template

<%@  Language="C#" %>
<asp:Label ID="InnerControl" runat="server" />

Edit view template

<%@  Language="C#" %>
<asp:CheckBoxList CssClass="sn-ctrl sn-ctrl-checkboxgroup" ID="InnerControl" runat="server" />
<asp:TextBox CssClass="sn-ctrl sn-ctrl-text sn-ctrl-extravalue" ID="ExtraTextBox" runat="server" />

Example/Tutorials

Simple example

   <sn:CheckBoxGroup ID="CheckBoxGroup1" runat="server" FieldName="Style" />

Templated example

   <sn:CheckBoxGroup ID="CheckBoxGroup1" runat="server" FieldName="Style">
      <EditTemplate>
         <asp:CheckBoxList ID="InnerControl" runat="server" />
         <asp:TextBox ID="ExtraTextBox" runat="server" />
      </EditTemplate>
   </sn:DropDown>

Related links

References