对gridview实在是不熟悉,网上有些代码,可用那种方法就不能使用排序了。我想使用页导航来做个假的双标题。在aspx里已经写<PagerSettings Position="TopAndBottom" />了。在.cs里
    protected void GV_pcqk_query_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.Pager)
        {
            //TableCell TC = (TableCell)e.Row.Cells;
            TableCell TC = (TableCell)e.Row.Cells[0];
            TC.Controls.Clear();
            TC.ColumnSpan=3;
            TC.Controls.Add(new LiteralControl("合计"));
            e.Row.Controls.Add(TC);
        }
        }
可是页面上就是不显示。请问谁有更好的办法,要是能实现表头固定就更好了。最好有gridview的例子。

解决方案 »

  1.   

    http://singlepine.cnblogs.com/archive/2005/11/23/282990.html
      

  2.   

    感谢楼上的,这个我已经看过了,03 和05的对象名称变化太多,我没时间去核对,我想要gridview的,因为对gridview不熟悉,所以才来发贴子,仍然感谢你,不过这个回复肯定没分,除非你给我讲明白.  :-)
      

  3.   

    http://oursun.gysunclub.com/article.asp?id=127
    这个可能对大家有用,可对我没用,我要做的表格太大了,这么改得累死我
      

  4.   

    找到原因了,是因为页面里记录太少,所以导航页没显示,谁能告诉我记录只有一页时怎么强制显示pager页
      

  5.   

    考虑用Repeater了,用HeaderTemplate
      

  6.   

    如果标题比较复杂的话,建议用repeater,不一定非要用gridview. 当然控制gridview的cell.span 也是可以的.排序的功能估计就不行了.
      

  7.   

    用repeater改动太大了,还是想用这个办法