RM.Common/DotNetUI/ControlBindHelper.cs

(开头部分) 14KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;

namespace RM.Common.DotNetUI
{
    public class ControlBindHelper
    {
        public static void BindGridViewList(DataTable table, GridView grid)
        {
            if (table == null || table.Rows.Count == 0)
            {
                table = table.Clone();
                table.Rows.Add(table.NewRow());
                grid.DataSource = table;
                grid.DataBind();
                int columnCount = table.Columns.Count;
                grid.Rows[0].Cells.Clear();
                grid.Rows[0].Cells.Add(new TableCell());
                grid.Rows[0].Cells[0].ColumnSpan = columnCount;
                grid.Rows[0].Cells[0].Text = "没有找到您要的相关数据";
                grid.Rows[0].Cells[0].Style.Add("text-align", "center");
            }
            else
            {
                grid.DataSource = table;
                grid.DataBind();
            }
        }

        public static void BindGridViewList(IList list, GridView grid)
        {
            grid.DataSource = list;
            grid.DataBind();
        }

        public static void BindRepeaterList(DataTable dt, Repeater repeater)
        {
            repeater.DataSource = dt;
            repeater.DataBind();
        }

        public static void BindRepeaterList(IList list, Repeater repeater)
        {
            repeater.DataSource = list;
            repeater.DataBind();
        }

        public static void BindRepeaterList<T>(IList<T> list, Repeater repeater)
        {
            repeater.DataSource = list;
            repeater.DataBind();
        }

        public static void BindDropDownList(DataTable dt, DropDownList dropdownlists, string _Name, string _ID, string _Memo)
后面还有 345 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。