这么点分,就只能告诉你,datagridtablesytle,datagridcolumnssytle

解决方案 »

  1.   

    //哎,没办法,以前我也是这样看别人的代码的,我可是出了一百分呀,现在也到你看看啦.应能看懂的.....当然还要在FORM中定义设置一些必要的变量名.
    自己动一动手吧,会记忆更深刻的.
    祝你好运.
    private void MakeDataSet()
    {
    // 建一个DataSet.
    myDataSet = new DataSet("myDataSet");
    //建立1个 DataTables.
    DataTable tCust = new DataTable("Customers");
    // 建两个columns, 和增加第一个 table.
    DataColumn cCustID = new DataColumn("CustID", typeof(int));
    DataColumn cCustName = new DataColumn("用户名");
    DataColumn cCurrent = new DataColumn("真的买吗?", typeof(bool));
    tCust.Columns.Add(cCustID);
    tCust.Columns.Add(cCustName);
    tCust.Columns.Add(cCurrent);
    //增加一表到DataSet
    myDataSet.Tables.Add(tCust);
    DataRow newRow1;
    // Create three customers in the Customers Table.
    for(int i = 0; i < 4; i++)
    {
    newRow1 = tCust.NewRow();
    newRow1["custID"] = i;
    tCust.Rows.Add(newRow1);
    }
    // Give each customer a distinct name.
    tCust.Rows[0]["用户名"] = "第一个";
    tCust.Rows[1]["用户名"] = "第二个";
    tCust.Rows[2]["用户名"] = "第三个";
    tCust.Rows[3]["用户名"] = "第四个";
    // Give the Current column a value.
    tCust.Rows[0]["真的买吗?"] = true;
    tCust.Rows[1]["真的买吗?"] = true;
    tCust.Rows[2]["真的买吗?"] = false;
    tCust.Rows[3]["真的买吗?"] = false;//绑定数据
    dataTable=myDataSet.Tables["Customers"];
    DataView dv=new DataView(dataTable);
    myDataGrid.DataSource=dv;
    //
    }
      

  2.   

    噢,很抱歉.你原来是要改列标题.
    GridColumnStylesCollection colStyle;
    colStyle = myDataGrid.TableStyles[0].GridColumnStyles;
    colStyle[2].HeaderText ="第二列的标题";
      

  3.   

    GridColumnStylesCollection 的命名空间是windows form。
    我是在web上构造的阿,所以提示没有using?
    感谢大家,分真的很重要吗?
    那么Unix的思想在IT人中深入的不彻底阿?呵呵