将AutoGenerateColumns="true"改为AutoGenerateColumns="false"<asp:BoundColumn
           DataField="DataSourceField"
           DataFormatString="FormatString"
           FooterText="FooterText"
           HeaderImageUrl="url"
           HeaderText="HeaderText"
           ReadOnly="True|False"
           SortExpression ="DataSourceFieldToSortBy"
           Visible="True|False"
           FooterStyle-property="value"
           HeaderStyle-property="value"
           ItemStyle-property="value"/>
ms-help://MS.NETFrameworkSDKv1.1.CHS/cpgenref/html/cpcondatagridwebservercontrol.htm

解决方案 »

  1.   

    把DataGrid的属性生成器中的列属性中的在运行时自动创建列的checkbox的勾去掉,在选定列中添加绑定列,将绑定列的页眉文本设为“城市代码”,数据字段设为:“C_CityCode”即可!
      

  2.   

    把DataGrid的属性生成器中的列属性中的在运行时自动创建列的checkbox的勾去掉,在选定列中添加绑定列,将绑定列的页眉文本设为“城市代码”,数据字段设为:“C_CityCode”即可!
      

  3.   

    有二个方法:
    1。用Sql语句.如:select C_CityCode as 城市代码 from 表名
                     然后绑定DataGrid。2。在DataGrid的属性生成器中的列属性中的在运行时自动创建列的checkbox的勾去掉,在选定列中添加绑定列,将绑定列的页眉文本设为“城市代码”,数据字段设为:“C_CityCode”即可
      

  4.   

    <asp:BoundColumn
               DataField="C_CityCode"
               HeaderText="城市代码"
               />