1
Answer

Its cant call the first data on textbox (only on the second)

Israel

Israel

9y
567
1
Hi!


I need to understand this logical behaviour.
I have three column with data that I am calling to appear on my textboxes (three textboxes: txtBox1 for compnay, txtBox2 for code and txtBox3 for nacionality).
Curiosly, when I click on the button to call the data to appear on those three TextBoxs. It's given me always this message Column named code cannot be found. Parameter name: columnName. But when I check in my database I find in that the code's column is there correctly writted.
In one word, Its make filter ONLY from the second column (code). Not from the first column (company).
when I write on my company's textbox there is a filter on the datagrid... then I click on the data I need. But its give a bugg (always on the second column. Never show data on textboxes from the first column to the thirth).

My codes:

private void dvgFacturacao_CellContentClick(object sender, DataGridViewCellEventArgs e)

        {

            if (e.RowIndex >= 0)

            {

                DataGridViewRow row = this.dvgFacturacao.Rows[e.RowIndex];

                if (dvgFacturacao != null)

 

                txtBox1.Text = row.Cells["company"].Value.ToString();

                txtBox2.Text = row.Cells["cod"].Value.ToString();

                txtBox3.Text = row.Cells["nacionality"].Value.ToString();               

        }



Answers (1)