在前一版本中,Insus.NET已经实现GridView头中放置CheckBox,可以对Gridview的行进行全选或是全取消的操作。
http://www.cnblogs.com/insus/archive/2013/01/20/2868532.html
更早前一版:
http://www.cnblogs.com/insus/articles/1411613.html
此次版本,主要是实现Gridview的Header的CheckBox 选择的效果。 如果所有记录行非选择时,改变此CheckBox的效果。
OK, 演示之前,先准备演示数据与环境。
首先写好一个对象:
using System; using System.Collections.Generic; using System.Linq; using System.Web; /// <summary> /// Summary description for Soup /// </summary> namespace Insus.NET { public class Soup { private string _Area; private string _Country; private string _SoupName; public string Area { get { return _Area; } set { _Area = value; } } public string Country { get { return _Country; } set { _Country = value; } } public string SoupName { get { return _SoupName; } set { _SoupName = value; } } public Soup() { // // TODO: Add constructor logic here // } public Soup(string area, string country, string soupName) { this._Area = area; this._Country = country; this._SoupName = soupName; } } }