Jair Souza
New member
- Joined
- Oct 3, 2013
- Messages
- 3
- Programming Experience
- Beginner
Hello, I have a Windows Form which has a tabcontrol page1 with the format Details "Register" and page2 GridView "Consultation".
The form starts on page1, the BindingNavigator created the Change button that enables the textbox to be changed ... after that I have the option
Save or cancel. The issue is that saving or canceling it moves to the first record, regardless of the option must
He chosen to remain in the same record. How to do this?
I set up this code, but when you open the form you need to go in TabPage2 where the grid, to work ... if it gives the following error
"Specified argument was out of the range of valid values. Parameter name: value."
what needs to change to work without going on the grid?
* Remember that I'm totally beginner, I got this code doing research and adaptations.
Privaite nomove void ()
linhaSelecionada int = 0 primeiraLinha = 0;
if (dataGridView.CurrentRow! = null)
{
primeiraLinha = dataGridView.FirstDisplayedScrollingRowIndex;
linhaSelecionada = dataGridView.CurrentRow.Index;
}
this.locatarioTableAdapter.Fill (this.bDBiblioteca2DataSet.Locatario);
dataGridView.FirstDisplayedScrollingRowIndex = primeiraLinha;
DataGridView.Rows [linhaSelecionada]. Selected = true;
dataGridView.CurrentCell DataGridView.Rows = [linhaSelecionada]. Cells [1];
I appreciate if you can help.
The form starts on page1, the BindingNavigator created the Change button that enables the textbox to be changed ... after that I have the option
Save or cancel. The issue is that saving or canceling it moves to the first record, regardless of the option must
He chosen to remain in the same record. How to do this?
I set up this code, but when you open the form you need to go in TabPage2 where the grid, to work ... if it gives the following error
"Specified argument was out of the range of valid values. Parameter name: value."
what needs to change to work without going on the grid?
* Remember that I'm totally beginner, I got this code doing research and adaptations.
Privaite nomove void ()
linhaSelecionada int = 0 primeiraLinha = 0;
if (dataGridView.CurrentRow! = null)
{
primeiraLinha = dataGridView.FirstDisplayedScrollingRowIndex;
linhaSelecionada = dataGridView.CurrentRow.Index;
}
this.locatarioTableAdapter.Fill (this.bDBiblioteca2DataSet.Locatario);
dataGridView.FirstDisplayedScrollingRowIndex = primeiraLinha;
DataGridView.Rows [linhaSelecionada]. Selected = true;
dataGridView.CurrentCell DataGridView.Rows = [linhaSelecionada]. Cells [1];
I appreciate if you can help.
Last edited: