binding navigation doesn't work? :S

  • Thread starter Thread starter Alcibiade
  • Start date Start date
A

Alcibiade

Hi to all,
this problem is aching my head:
I have a datagridview in binding
When a user select a record, I need to get the previous record data.
Simply I did it:

this.periodBindingSource.MovePrevious() ;//I move to
previous record
previousdataRow = (periodBindingSource.Current as
DataRowView);//I store informations of previous record
this.periodBindingSource.MoveNext();//I go back to user
selected record

The problem is that after MoveNext, the current record of binding
source remains the previous, like the last instruction was ignored.
Why?
How can I solve this?
Thanks
 
Hi to all,
this problem is aching my head:
I have a datagridview in binding
When a user select a record, I need to get the previous record data.
Simply I did it:

             this.periodBindingSource.MovePrevious() ;//I move to
previous record
            previousdataRow = (periodBindingSource.Current as
DataRowView);//I store informations of previous record
            this.periodBindingSource.MoveNext();//I go back to user
selected record

The problem is that after MoveNext, the current record of binding
source remains the previous, like the last instruction was ignored.
Why?
How can I solve this?
Thanks

Solved...I have an instruction in a "current_changed" event .
Anyway, How can I navigate among records on datatable? Using the
binding, I can navigate records but they could change their order,
instead I want navigate them in the same way as they are stored on
datatable.
Thanks :)
 
Back
Top