protected void Page_Load(object sender, EventArgs e)
        {
            this.Pub1.AddTable("width=90% align=center");
            this.Pub1.AddCaptionLeft("请选择要显示的字段,然后点保存按钮.");
            MapAttrs    mattrs = new MapAttrs();
            QueryObject qo     = new QueryObject(mattrs);

            qo.AddWhere(MapAttrAttr.FK_MapData, this.FK_MapData);
            qo.addOrderBy(MapAttrAttr.X, MapAttrAttr.Y);
            qo.DoQuery();

            //已设置
            FrmReportFields reportFields = new FrmReportFields();

            reportFields.RetrieveByAttr(FrmReportFieldAttr.FK_MapData, FK_MapData);

            int  cols = 4; //定义显示列数 从0开始。
            int  idx  = -1;
            bool is1  = false;

            foreach (MapAttr attr in mattrs)
            {
                idx++;
                if (idx == 0)
                {
                    is1 = this.Pub1.AddTR(is1);
                }

                CheckBox cb = new CheckBox();
                cb.ID      = "CB_" + attr.KeyOfEn;
                cb.Text    = attr.Name + "(" + attr.KeyOfEn + ")";
                cb.Checked = reportFields.Contains(FrmReportFieldAttr.KeyOfEn, attr.KeyOfEn);
                this.Pub1.AddTD(cb);

                if (idx == cols - 1)
                {
                    idx = -1;
                    this.Pub1.AddTREnd();
                }
            }
            while (idx != -1)
            {
                idx++;
                if (idx == cols - 1)
                {
                    idx = -1;
                    this.Pub1.AddTD();
                    this.Pub1.AddTREnd();
                }
                else
                {
                    this.Pub1.AddTD();
                }
            }
            CheckBox cbAll = new CheckBox();

            cbAll.ID              = "CB_CheckedAll";
            cbAll.Text            = "全选";
            cbAll.AutoPostBack    = true;
            cbAll.Checked         = IsChecked == "true" ? true : false;
            cbAll.CheckedChanged += new EventHandler(cbAll_CheckedChanged);
            this.Pub1.AddTR();
            this.Pub1.AddTD("colspan=4", cbAll);
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
        }