コード例 #1
0
 internal override void MergeCheckBoxAttributes(TagBuilder tag, RenderContext context)
 {
     base.MergeCheckBoxAttributes(tag, context);
     if (CheckedValue == null)
     {
         throw new XamlException("The CheckedValue attribute is required for Radio");
     }
     tag.MergeAttribute("value", CheckedValue.ToString());
 }
コード例 #2
0
ファイル: Radio.cs プロジェクト: alex-kukhtin/A2v10
        internal override void MergeCheckBoxAttributes(TagBuilder tag, RenderContext context)
        {
            base.MergeCheckBoxAttributes(tag, context);
            var chv = GetBinding(nameof(CheckedValue));

            if (chv != null)
            {
                tag.MergeAttribute(":value", chv.GetPathFormat(context));
            }
            else if (CheckedValue != null)
            {
                tag.MergeAttribute("value", CheckedValue.ToString());
            }
            else
            {
                throw new XamlException("The CheckedValue attribute is required for Radio");
            }
        }
コード例 #3
0
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);

        PortalHelper.EnsureScriptManager(Page);

        // Initialize checkbox for special values
        if ((FieldInfo != null) && (FieldInfo.DataType != FormFieldDataTypeEnum.Boolean))
        {
            if (CheckedValue == null)
            {
                CheckedValue = DataHelper.GetNotEmpty(GetValue("CheckedValue"), "");
            }
            if (UncheckedValue == null)
            {
                UncheckedValue = DataHelper.GetNotEmpty(GetValue("UncheckedValue"), "");
            }

            string innerValueString = ValidationHelper.GetString(innerValue, null);
            checkbox.Checked = CMSString.Equals(CheckedValue.ToString(), innerValueString);
        }
    }
コード例 #4
0
    /// <summary>
    /// Compares inner string value with checked value and sets the check box accordingly.
    /// </summary>
    private void HandleStringValue()
    {
        var innerValueString = ValidationHelper.GetString(mInnerValue, null);

        checkbox.Checked = CMSString.Equals(CheckedValue.ToString(), innerValueString);
    }