|
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
namespace RadioButtonGridView
{
public class RadioButtonTemplate : ITemplate
{
public RadioButtonTemplate()
{
}
public void InstantiateIn(Control container)
{
RadioButtonEx radioButton = new RadioButtonEx()
{
ID = _radioButtonID,
GroupName = _radioButtonGroupName,
AutoPostBack = _radioButtonAutoPostBack
};
container.Controls.Add(radioButton);
}
#region Public Properties
// ============================================
private Boolean _radioButtonAutoPostBack = true;
/// <summary>
/// Ges or sets the flag to determine whether the internal radio button should automatically post back.
/// </summary>
public Boolean RadioButtonAutoPostBack
{
get
{
return _radioButtonAutoPostBack;
}
set
{
_radioButtonAutoPostBack = value;
}
}
// ==========================================
private String _radioButtonGroupName;
/// <summary>
/// Gets or sets the internal radio button group name.
/// </summary>
public String RadioButtonGroupName
{
get
{
return _radioButtonGroupName;
}
set
{
_radioButtonGroupName = value;
}
}
// ====================================
private String _radioButtonID;
/// <summary>
/// Gets or sets the internal radio button ID.
/// Note that the UniqueID of each radio button composed by NamingContainer UniqueID and
/// itself ID.
/// </summary>
public String RadioButtonID
{
get
{
return _radioButtonID;
}
set
{
_radioButtonID = value;
}
}
#endregion
}
}
|
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.