Backup/Discuz.Control/CheckBoxList.cs
(开头部分) 8KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System.Data;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
using Discuz.Common;
using Discuz.Data;
namespace Discuz.Control
{
/// <summary>
/// CheckBoxList 控件。
/// </summary>
[DefaultProperty("Text"), ToolboxData("<{0}:CheckBoxList runat=server></{0}:CheckBoxList>")]
public class CheckBoxList : System.Web.UI.WebControls.CheckBoxList, Discuz.Control.IWebControl, IPostBackDataHandler
{
/// <summary>
/// 构造函数
/// </summary>
public CheckBoxList(): base()
{
//this.BorderStyle=BorderStyle.Dotted;
//this.BorderWidth=1;
//this.Font.Size=10;
this.RepeatColumns=2;
this.Width=Unit.Percentage(100);
//this.Font.Size=FontUnit.Smaller;
this.RepeatDirection=RepeatDirection.Vertical;
this.RepeatLayout = RepeatLayout.Table;
this.CssClass = "buttonlist";
}
/// <summary>
/// 添加表数据
/// </summary>
/// <param name="dt">要绑定的表</param>
public void AddTableData(DataTable dt)
{
this.Items.Clear();
foreach( DataRow r in dt.Rows )
{
this.Items.Add(new ListItem(r[1].ToString(),r[0].ToString()));
}
this.DataBind();
}
public void AddTableData(DataTable dt, string textName, string valueName)
{
this.Items.Clear();
foreach (DataRow r in dt.Rows)
{
this.Items.Add(new ListItem(r[textName].ToString(),r[valueName].ToString()));
}
this.DataBind();
}
/// <summary>
/// 添加表数据
后面还有 229 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
