第一个用DataGrid.ReadOnly=true;
第二个
DataSet.Tables["yourtable"].DefaultView.AllowNew=false;
DataGrid.DataSource =DataSet.Tables["yourtable"].DefaultView;

解决方案 »

  1.   

    srnld(天涯)
    第一个:
    用DataGrid.ReadOnly=true的话,我就不能在DataGrid中的修改数据第二个:
    DataSet.Tables["yourtable"].DefaultView.AllowNew=false;
    DataGrid.DataSource =DataSet.Tables["yourtable"].DefaultView;
    我就不能通过键盘来增加行,而得用程序写了,有没有其他的办法?
      

  2.   

    第一个:
    dataGrid的RowhHeaderVisiable设为false,试一试
      

  3.   

    1。在Delphi中,设为readonly=true;修改时在改回来
    2。好像对数据没有影响,可以不管吧
    ^_^
      

  4.   

    你加了TableStyles吧?
    这样的话你要设置TableStyles里的RowhHeaderVisiable为false
      

  5.   

    5.55 How can I put up a confirmation question when the user tries to delete a row in the datagrid by clicking on the row header and pressing the Delete key?
    http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q889q5.5 How do I prevent the datagrid from displaying its append row (the row at the end with an asterisk)?
    http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q653q