打印本文 打印本文 关闭窗口 关闭窗口
有滚动条、固定Header的ASP.Net DataGrid实现
作者:武汉SEO闵涛  文章来源:敏韬网  点击数3599  更新时间:2009/4/23 10:43:52  文章录入:mintao  责任编辑:mintao

              //on server side if the the page is with flow-layout.

              this.ID + "_Headers" + @".style.left = " + this.ID + @"_div.offsetLeft;

                                                                " +

              this.ID + "_Headers" + @".style.top = " + this.ID + @"_div.offsetTop;

                                                                " +

              this.ID + "_Headers" + @".style.position = ''''absolute'''';

                                                </script>";

            Page.RegisterStartupScript("dummyKey" + this.ID, adjustWidthScript);

            //output.Write(adjustWidthScript);

          }

          Height = tempHeight;

          Style["TABLE-LAYOUT"] = tempTableStyle;

        }

      }

    }

               

    protected override void OnInit(EventArgs e)

    {

      if (0 == Width.Value) Width = new Unit("400px");

      if (0 == Height.Value) Height = new Unit("200px");

      //Transparent header is not allowed.

      if (HeaderStyle.BackColor.IsEmpty)

      {

        HeaderStyle.BackColor = Color.White;

      }

      //Transparent pager is not allowed.

      if (PagerStyle.BackColor.IsEmpty)

      {

        PagerStyle.BackColor = Color.White;

      }

 

      base.OnInit (e);

    }

 

    [Browsable(false)]

    public override bool ShowHeader

    {

      get

      {

        return true;

      }

      set

      {

        if (false == value)

          throw new InvalidOperationException("Use the original DataGrid to set ShowHeaders to false.");

      }

    }

  }

}

上一页  [1] [2] [3] [4] [5] 

打印本文 打印本文 关闭窗口 关闭窗口