|
// -- FILE ------------------------------------------------------------------
// name : RadioButtonList.cs
// project : Itenso Web User Forms
// created : Jani Giannoudis - 2008.10.30
// language : c#
// environment: .NET 2.0
// copyright : (c) 2008-2012 by Itenso GmbH, Switzerland
// --------------------------------------------------------------------------
using System;
using System.Drawing;
using System.ComponentModel;
namespace Itenso.WebUserForms.Controls
{
// ------------------------------------------------------------------------
[DefaultProperty( "FieldName" )]
[Designer( typeof( UserFormFieldDesigner ) )]
[ToolboxBitmap( typeof( ResFinder ), "Itenso.WebUserForms.Controls.Images.RadioButtonList.png" )]
public class RadioButtonList : System.Web.UI.WebControls.RadioButtonList, IListField
{
// ----------------------------------------------------------------------
[DefaultValue( "" )]
[Description( "RadioButtonList Form Field Name" )]
[Category( "Web User Forms" )]
public string FieldName { get; set; }
// ----------------------------------------------------------------------
[DefaultValue( "" )]
[Description( "RadioButtonList 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; }
} // IUserFormField.AllowEdit
// ----------------------------------------------------------------------
[Browsable( false )]
public string OnClickClientScript
{
get { return onClickClientScript; }
set { onClickClientScript = value; }
} // OnClickClientScript
// ----------------------------------------------------------------------
protected override void OnPreRender( EventArgs e )
{
base.OnPreRender( e );
if ( !string.IsNullOrEmpty( onClickClientScript ) )
{
Attributes.Add( "onClick", onClickClientScript );
}
} // OnPreRender
// ----------------------------------------------------------------------
public override string ToString()
{
return FormFieldTool.GetFieldDescription( this );
} // ToString
// ----------------------------------------------------------------------
// members
private string onClickClientScript;
} // class RadioButtonList
} // namespace Itenso.WebUserForms.Controls
// -- EOF -------------------------------------------------------------------
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
👨 Senior .NET Software Engineer
🚀 My Open Source Projects
-
Time Period Library 👉
GitHub
-
Payroll Engine 👉
GitHub
Feedback and contributions are welcome.