void cboFieldType_SelectedIndexChanged(object sender, EventArgs e) { var newType = DataType.ByName(cboFieldType.SelectedValue); CheckCast(newType); ShowOrHideSettingsByType(newType); FormFieldSettings.Show(newType); ListFieldSettings.Show(newType); }
void Page_Load(object sender, EventArgs e) { divError.Visible = false; divWarning.Visible = false; if (IsPostBack) { var selectedType = DataType.ByName(cboFieldType.SelectedValue); FormFieldSettings.Show(selectedType); ListFieldSettings.Show(selectedType); } }
public void Bind() { txtFieldTitle.Text = DataSource[FieldsTableColumn.Title].AsString(); var type = DataType.ByName(DataSource[FieldsTableColumn.Type].AsString("String")); cboFieldType.DataSource = type.IsUserDefinedField ? DataType.ContentDataTypes() : DataType.SystemDataTypes(); cboFieldType.DataBind(); cboFieldType.SelectedValue = type.Name; lblType.Text = type.GetLocalization(); txtHelpText.Text = DataSource[FieldsTableColumn.HelpText].AsString(); txtDefault.Text = DataSource[FieldsTableColumn.Default].AsString(); var inputSettings = DataSource[FieldsTableColumn.InputSettings].AsString(); chkRequired.Checked = DataSource[FieldsTableColumn.Required].AsBoolean(); chkDisplayOnList.Checked = DataSource[FieldsTableColumn.Visible].AsBoolean(); chkRestrictedFormField.Checked = DataSource[FieldsTableColumn.IsPrivate].AsBoolean(); chkSearchable.Checked = DataSource[FieldsTableColumn.Searchable].AsBoolean(); if (inputSettings.EndsWith(Definition.verticalRadioButtonEnabledToken)) { rblListType.SelectedValue = "RadioButtons"; } else if (inputSettings.EndsWith(Definition.horizontalRadioButtonEnabledToken)) { rblListType.SelectedValue = "RadioButtonsHorizontal"; } txtInputSettings.Text = Regex.Replace(inputSettings, "-\\[\\[(?:h|v)RBL]]$", ""); txtOutputSettings.Text = DataSource[FieldsTableColumn.OutputSettings].AsString(); chkNormalizeFlag.Checked = DataSource[FieldsTableColumn.NormalizeFlag].AsBoolean(); chkMultipleValues.Checked = DataSource[FieldsTableColumn.MultipleValues].AsBoolean(); chkShowOnEdit.Checked = DataSource[FieldsTableColumn.ShowOnEdit].AsBoolean(); txtValidationRule.Text = DataSource[FieldsTableColumn.ValidationRule].AsString(); txtValidationMessage.Text = DataSource[FieldsTableColumn.ValidationMessage].AsString(); txtEditStyle.Text = DataSource[FieldsTableColumn.EditStyle].AsString(); if (cboInputSettings.Visible) { cboInputSettings.SelectedValue = inputSettings.AsString("String"); } ShowOrHideSettingsByType(type); var id = DataSource[FieldsTableColumn.Id].AsInt(); DataBind(); if (!IsPostBack) { FormFieldSettings.Show(type); FormFieldSettings.BindData(id, Settings, type); ListFieldSettings.Show(type); ListFieldSettings.BindData(id, Settings, type); } }