RadioButtonList.cs
上传用户:husern
上传日期:2022-03-24
资源大小:534k
文件大小:3k
源码类别:

编辑器/阅读器

开发平台:

C#

  1. // -- FILE ------------------------------------------------------------------
  2. // name       : RadioButtonList.cs
  3. // project    : Itenso Web User Forms
  4. // created    : Jani Giannoudis - 2008.10.30
  5. // language   : c#
  6. // environment: .NET 2.0
  7. // copyright  : (c) 2008 by Itenso GmbH, Switzerland
  8. // --------------------------------------------------------------------------
  9. using System;
  10. using System.Drawing;
  11. using System.ComponentModel;
  12. using System.Web.UI.WebControls;
  13. namespace Itenso.WebUserForms.Controls
  14. {
  15. // ------------------------------------------------------------------------
  16. [DefaultProperty( "FieldName" )]
  17. [Designer( typeof( UserFormFieldDesigner ) )]
  18. [ToolboxBitmap( typeof( ResFinder ), "Itenso.WebUserForms.Controls.Images.RadioButtonList.png" )]
  19. public class RadioButtonList : System.Web.UI.WebControls.RadioButtonList, IListField
  20. {
  21. // ----------------------------------------------------------------------
  22. [DefaultValue( "" )]
  23. [Description( "RadioButtonList Form Field Name" )]
  24. [Category( "Web User Forms" )]
  25. public string FieldName
  26. {
  27. get { return this.fieldName; }
  28. set { this.fieldName = value; }
  29. } // FieldName
  30. // ----------------------------------------------------------------------
  31. [DefaultValue( "" )]
  32. [Description( "RadioButtonList Form Field Value" )]
  33. [Category( "Web User Forms" )]
  34. public string FieldValue
  35. {
  36. get { return ListControlTool.GetSelectionValue( this ); }
  37. set
  38. {
  39. ListControlTool.ResetItemSelection( this );
  40. ListControlTool.SetSelectionValue( this, value );
  41. }
  42. } // FieldValue
  43. // ----------------------------------------------------------------------
  44. [Browsable( false )]
  45. bool IUserFormField.AllowEdit
  46. {
  47. get { return Enabled; }
  48. set { Enabled = value; }
  49. } // AllowEdit
  50. // ----------------------------------------------------------------------
  51. [Browsable( false )]
  52. public string OnClickClientScript
  53. {
  54. get { return this.onClickClientScript; }
  55. set { this.onClickClientScript = value; }
  56. } // OnClickClientScript
  57. // ----------------------------------------------------------------------
  58. protected override void OnPreRender( EventArgs e )
  59. {
  60. base.OnPreRender( e );
  61. if ( !string.IsNullOrEmpty( this.onClickClientScript ) )
  62. {
  63. Attributes.Add( "onClick", this.onClickClientScript );
  64. }
  65. } // OnPreRender
  66. // ----------------------------------------------------------------------
  67. public override string ToString()
  68. {
  69. return FormFieldTool.GetFieldDescription( this );
  70. } // ToString
  71. // ----------------------------------------------------------------------
  72. // members
  73. private string fieldName;
  74. private string onClickClientScript;
  75. } // class RadioButtonList
  76. } // namespace Itenso.WebUserForms.Controls
  77. // -- EOF -------------------------------------------------------------------