Kisankoori 0 Newbie Poster

Hi All,

I am developing a Windows Forms 2.0 application. I have some questions on the DataGridView.

I have two Datagridviews on the form which I have populated from the the database tables customer_group, and group using the datasource wizard. The table group for the gridview contains columns GroupID int and Name varchar datatypes and the table customer_group contains customerID int, GroupID int, memberNumber int. I have a Cell_Click event on the first gridview and when I click on the button in the group gridview it should add the particular row into the second gridview which is customer_gridview. but it gives me the following error.

Input string was not in a correct format

Could you please give me some idea and some code examples. I really appreciate your help.

Here is the Cell_Clickevent

private void groupDataGridView_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            //MessageBox.Show("Cell click");

            if (e.ColumnIndex == 0)
            {

                this.customer_GroupTableAdapter.Insert(int.Parse(this.customerIDTextBox.Text),
                    int.Parse(this.groupDataGridView.Rows[e.RowIndex].Cells[1].Value.ToString()), null);



            }

Kisankoori