列很多,比如有100列,DATAGRID肯定会有滚动条,默认是在最左面,我想看第50列,必须滑动滚动条才能看到,能不能让它填充完数据就显示到第50列?

解决方案 »

  1.   

    你可以先自己创建一个DataSet然后创建一个表,再在表里面添加你象先显示的列
    eg:
        myDataSet.Tables.Add(new DataTable("Example"));
        myDataSet.Tables[Example].Column.Add("YourFirstColum",System.Type.GetType("ColumnType"));
        ………………
        最后将myDataSet绑定到DataGrid就可以了
      

  2.   

    楼上的方法只显示加进myDataSet.Tables[Example]的列
    如果有100列,我想datagrid填充数据后直接看到50列,但前面49列也在datagrid里面,只不过是下面滚动条的位置不在最左面
      

  3.   

    参考
    DataGridCell cell = this.dataGridGoodsInfo.CurrentCell;
    cell.RowNumber = 1;
    cell.ColumnNumber = 10;
    this.dataGridGoodsInfo.CurrentCell = cell;
      

  4.   

    呵呵,select 的时候不要写select *  , 写select b,a,c 则不按a,b,c而是按b,a,c排序了。
      

  5.   

    指定当前格点CurrentCell
     hanbinghai(海宁)正解