好象是在编辑列里面可以删掉不要显示的列,改标题的话,只要在列的HeadText里改就行了吧,楼主试试

解决方案 »

  1.   

    直接用VS提供的DataGrid控件即可,直接在属性栏里设置。
      

  2.   

    用objectdatasource作为数据源能编辑列么?我怎么看不到?
      

  3.   

    不是数据源控件,是gridview控件上直接编辑即可.
      

  4.   

    我是用一个objectdatasource的select命令返回一个datatable。这样得到的这个人员集合的逻辑和前台面有关联。
    但用objectdatasource作为GridView的数据源,gridview并没有自动获取相关的列啊。
      

  5.   

    create a new method eg. GetNameAndAge() in your strong-typed dataset of Data access layer.Afterwards, bind the this method to your GridView.protected void Page_Load(object sender, EventArgs e)
        {
            StudentsTableAdapter StudentsAdapter = new
             StudentsTableAdapter();
            GridView1.DataSource = StudentsAdapter.GetNameAndAge();
            GridView1.DataBind();
        }
      

  6.   

    check this tutorial
    http://asp.net/learn/dataaccess/tutorial01cs.aspx?tabid=63
      

  7.   

    ssy888():I'm not using a strong-typed dataset. I do have a similar method name select(), it returns a datatable. 
    But I got this problem.