title | source_url | category | version | tags | |||||
---|---|---|---|---|---|---|---|---|---|
DropDown Field Control |
Development |
v6.0 |
|
Although this feature is supported in sensenet 7, it is built on the old Web Forms technology that you should not use for new projects. We encourage you to use a more modern UI solution using our client-side packages.
The DropDown Field Control displays a drop-down list for selecting an option from a single-selection Choice field.
When the underlying Choice Field is configured to allow extra value an extra textbox is rendered next to the dropdown control.
- SelectedValueType (optional): Sets the display type of the selected options in Browse mode. Possible values are Value and Text, default is Text.
Example:
<sn:DropDown ID="DropDown1" runat="server" FieldName="Style" SelectedValueType="Value" />
The DropDown Field Control renders a Label control in Browse mode and a DropDownList accompanied with a TextBox - the latter for an optional extra value - in Edit mode.
<%@ Language="C#" %>
<asp:Label ID="InnerControl" runat="server" />
<%@ Language="C#" %>
<asp:DropDownList CssClass="sn-ctrl sn-ctrl-select" ID="InnerControl" runat="server" />
<asp:TextBox CssClass="sn-ctrl sn-ctrl-text sn-ctrl-extravalue" ID="ExtraTextBox" runat="server" />
<sn:DropDown ID="DropDown1" runat="server" FieldName="Style" />
<sn:DropDown ID="DropDown1" runat="server" FieldName="Style">
<EditTemplate>
<asp:DropDownList ID="InnerControl" runat="server" />
<asp:TextBox ID="ExtraTextBox" runat="server" />
</EditTemplate>
</sn:DropDown>