binding navigation doesn't work? :S

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
 
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

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 :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top