zoukankan      html  css  js  c++  java
  • 扩展CheckBoxFieldPro

    CheckBoxField竟然不支持int型的数据

    现扩展加上int的支持,如果为0,则不选中,为1,则选中.

    代码:

       public class CheckBoxFieldPro : CheckBoxField
        {
            protected override void OnDataBindField(object sender, EventArgs e)
            {
                System.Web.UI.Control control = (System.Web.UI.Control)sender;
                System.Web.UI.Control namingContainer = control.NamingContainer;
                object obj2 = this.GetValue(namingContainer);
                if (obj2 is bool)
                {
                    ((CheckBox)control).Checked = (bool)obj2;
                }
                if (obj2 is int)
                {
                    ((CheckBox)control).Checked = (int)obj2 == 1 ? true : false;
                }
                ((CheckBox)control).Text = this.Text;
            }
        }

  • 相关阅读:
    spring ref &history&design philosophy
    LDAP & Implementation
    REST
    隔离级别
    Servlet Analysis
    Session&Cookie
    Dvelopment descriptor
    write RE validation
    hello2 source anaylis
    Filter
  • 原文地址:https://www.cnblogs.com/DataFlow/p/1446899.html
Copyright © 2011-2022 走看看