|
-
Apr 14th, 2015, 12:20 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] Binding Navigator Issue
I have a form that displays a single record from a table in a dataset. Like most forms of this type I have a binding navigator on the form. There are no problems with the binding navigator until I add a record to the table. What occurs is this.
If the binding navigator is located at the last record and I add a new record to the table then the binding navigator will show that record as the last record (which is the expected behavior). However, if I have the binding navigator located at the first record and add a new record then the binding navigator will show the new record as the first record. Additionally, I have another form that has a datagrid view and it appears to mirror what the binding navigator shows, with regard to the location of the new record. I checked the table in the database and the record is located at the bottom of the table as it should be.
It appears to me that I have some kind of indexing issue, and I have looked at the properties of the binding navigator and can see nothing that would do anything for this. Perhaps someone might explain to me what I am doing wrong here.
-
Apr 15th, 2015, 08:10 AM
#2
Re: Binding Navigator Issue
You are probably going to have to show code. Are you re-querying after adding and saving a record to the bindingsource datasource/datamember? Just because the item is located in the bottom of the table doesn't mean that's how it is going to display ion the front end. I am not sure in what order the items load in when order is not specified in the query, but I know that it is not always how the DB is ordered, hence why I always add order to my queries which use a field like "Date Entered" or something similar.
-
Apr 15th, 2015, 09:42 AM
#3
Thread Starter
Fanatic Member
Re: Binding Navigator Issue
Actually, I finally figured out the answer to the problem. First off, it turned out to not be a problem with the binding navigator. It was actually in the binding source. I did some looking and found that the sort property was empty and needed to be set to the field I wanted to sort on (the PK). Now what I cannot understand is why this program was ever able to work correctly at all when that property was empty? I actually never had set a query, so the only queries would have been ones that might have been auto set for the binding navigator "add" button.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|