CheckBoxList.cs
上传用户:husern
上传日期:2022-03-24
资源大小:534k
文件大小:3k
- // -- FILE ------------------------------------------------------------------
- // name : CheckBoxList.cs
- // project : Itenso Web User Forms
- // created : Jani Giannoudis - 2008.10.30
- // language : c#
- // environment: .NET 2.0
- // copyright : (c) 2008 by Itenso GmbH, Switzerland
- // --------------------------------------------------------------------------
- using System;
- using System.Drawing;
- using System.ComponentModel;
- using System.Web.UI.WebControls;
- namespace Itenso.WebUserForms.Controls
- {
- // ------------------------------------------------------------------------
- [DefaultProperty( "FieldName" )]
- [Designer( typeof( UserFormFieldDesigner ) )]
- [ToolboxBitmap( typeof( ResFinder ), "Itenso.WebUserForms.Controls.Images.CheckBoxList.png" )]
- public class CheckBoxList : System.Web.UI.WebControls.CheckBoxList, IListField
- {
- // ----------------------------------------------------------------------
- [DefaultValue( "" )]
- [Description( "CheckBoxList Field Name" )]
- [Category( "Web User Forms" )]
- public string FieldName
- {
- get { return this.fieldName; }
- set { this.fieldName = value; }
- } // FieldName
- // ----------------------------------------------------------------------
- [DefaultValue( "" )]
- [Description( "CheckBoxList Form Field Value" )]
- [Category( "Web User Forms" )]
- public string FieldValue
- {
- get { return ListControlTool.GetSelectionValue( this ); }
- set
- {
- ListControlTool.ResetItemSelection( this );
- ListControlTool.SetSelectionValue( this, value );
- }
- } // FieldValue
- // ----------------------------------------------------------------------
- [Browsable( false )]
- bool IUserFormField.AllowEdit
- {
- get { return Enabled; }
- set { Enabled = value; }
- } // AllowEdit
- // ----------------------------------------------------------------------
- [Browsable( false )]
- public string OnClickClientScript
- {
- get { return this.onClickClientScript; }
- set { this.onClickClientScript = value; }
- } // OnClickClientScript
- // ----------------------------------------------------------------------
- protected override void OnPreRender( EventArgs e )
- {
- base.OnPreRender( e );
- if ( !string.IsNullOrEmpty( this.onClickClientScript ) )
- {
- Attributes.Add( "onClick", this.onClickClientScript );
- }
- } // OnPreRender
- // ----------------------------------------------------------------------
- public override string ToString()
- {
- return FormFieldTool.GetFieldDescription( this );
- } // ToString
- // ----------------------------------------------------------------------
- // members
- private string fieldName;
- private string onClickClientScript;
- } // class CheckBoxList
- } // namespace Itenso.WebUserForms.Controls
- // -- EOF -------------------------------------------------------------------