see5.7 How can I select the entire row when the user clicks on a cell in the row?
http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q689q

解决方案 »

  1.   

    为何不用这个事件
    private void dataGrid1_CurrentCellChanged(object sender, System.EventArgs e)
    {
    this.BindingContext[arraylist1].Position=dataGrid1.CurrentRowIndex;
    lbl1.Text = dataGrid1.CurrentRowIndex.ToString();
    }
      

  2.   

    这个事件也一样,但是还是老问题,
    this.BindingContext[arraylist1].Position=dataGrid1.CurrentRowIndex;
    CurrentRowIndex好象不起作用的一样,一直都是0。
      

  3.   

    dataGrid1.CurrentCell.RowNumber跟CurrentRowIndex的值好象不一致的吧
      

  4.   

    to synchronize between datagrid and textboxes, you need to bind the same way, for example:DataSet ds;string ConnectionString = "data source=localhost;uid=sa;password=;database=pubs";
    SqlConnection cn = new SqlConnection(ConnectionString);
       
    ds = new DataSet("CustOrders");SqlDataAdapter da1 = new SqlDataAdapter("SELECT * FROM authors",cn);
    da1.TableMappings.Add("Table","Authors");
    da1.Fill(ds);
    dataGrid1.DataSource = ds;
    dataGrid1.DataMember = "Authors";textBox1.DataBindings.Add("Text", ds, "Authors.au_id");
    textBox2.DataBindings.Add("Text", ds, "Authors.au_fname");
    also see
    http://noiseehc.freeweb.hu/CurrencyManager.html