可以的,只把某一行的某一个段设定为可输入即可。
推荐实用代码网站。http://bingning.net/free/source/datagrid/index.html

解决方案 »

  1.   

    只允许编辑第二行第1列using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;namespace WindowsApplication239
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();            DataGridView DGV = new DataGridView();
                DGV.Parent = this;
                DGV.Columns.Add("c1", "c1");
                DGV.Columns.Add("c2", "c2");
                DGV.Rows.Add(new Object[] { 1,11 });
                DGV.Rows.Add(new Object[] { 2,22 });
                DGV.Rows.Add(new Object[] { 3 ,33});
                DGV.CellBeginEdit += new DataGridViewCellCancelEventHandler(DGV_CellBeginEdit); 
            }        void DGV_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e)
            {
                e.Cancel = !(e.RowIndex == 1 && e.ColumnIndex == 0);
            }
        }
    }
      

  2.   

    没那么麻烦吧,好像有个什么属性,设为false就可以了
    好像是,不敢肯定
      

  3.   


    在GridView的RowEditing事件中去写:    protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
        {
            //设置GridView的编辑行为当前行
            GridView1.EditIndex = e.NewEditIndex;
            //下面重新绑定数据
        }
      

  4.   

    看看这个例子吧
    http://www.cnblogs.com/sufei/archive/2009/03/14/1485995.html
      

  5.   

    可以<ItemTemplate>
    <%# Eval("name") %>
    </ItemTemplate> <EditItemTemplate > <asp:TextBox id="txt_name" CssClass="inputText"  MaxLength="100" runat="server" Text='<%# Eval("name") %>' Width="86%"> </asp:TextBox>
    </EditItemTemplate>
       protected void gv_RowUpdating(object sender, GridViewUpdateEventArgs e)
            {
                gv.EditIndex = e.RowIndex;
                
                string str=((TextBox)gv_PrcsProp.Rows[e.RowIndex].FindControl("txt_name")).Text.Trim());
                
                gv.EditIndex = -1;
                BindData();
            }
      

  6.   

    在等着我拿分?
    把要取消编辑的列转换为TemplateField,然后转到HTML源代码中,找到那一列,把EditTemplate里面的TextBox改成Label,就这么简单!
    推荐你研究一下:GridView 72般绝技http://blog.csdn.net/21aspnet/archive/2007/03/25/1540301.aspx
      

  7.   

    补充:转换为TemplateField的方法:点GridView,编辑列,找到你的列(不要用自动生成列),然后点它就能在右边看到转换为TemplateField。