Problem with adding new record


Author
Message
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Glad it helped, Thomas. http://forum.strataframe.net/Skins/Classic/Images/EmotIcons/Cool.gif
Thomas Holste
Thomas Holste
StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)
Group: StrataFrame Users
Posts: 144, Visits: 618
Hi Ivan,

thanks for your help. At first it did not work but after changing

dgvkunden.CurrentCell = dgvkunden.Item(0, dgvkunden.Rows.Count - 2)

to

dgvkunden.CurrentCell = dgvkunden.Item(0, dgvkunden.Rows.Count - 1)

it works really fine

Best regards

Thomas
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hi Thomas.

Find attached a video of your first sample, with the panel, working as I guess you expect. The only thing I did was to add a line in your New button click to navigate the grid to the newly added row. This is not a BBS responsibility, every different grid on the market will have its own way to do it. I didn't understand well what the bug would be, but maybe you are saying that a BBS wouldn't work on a panel? If so, I guess no, I haven't found any bug there, and I have BBS working in all different places through my applications, hundreds of BBSs.

This is how I navigated your grid:

        '-- navigate the Grid
        dgvkunden.CurrentCell = dgvkunden.Item(0, dgvkunden.Rows.Count - 2)


Of course, there are many ways to skin a cat, so you would just have to find the best one that would fit your needs.

Cheers.
Attachments
TestThomas.zip (87 views, 783.00 KB)
Thomas Holste
Thomas Holste
StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)
Group: StrataFrame Users
Posts: 144, Visits: 618
Hi Ivan,

sorry to say but I haven't got it going. My sample just shows that the Business Binding Source works right if the grid which uses the BBS is not placed on a panel like it was in the first example. I tested it a little further and added now to the working example a panel-manager and a page and placed the grid and the group-box woth the textboxes on it (The sample is attached). Guess what happens? It fails. To me it looks like a seroius bug in the business binding source component? If it is a bug, will it be fixed and when? Or is this limited by design and I have to redesign the interface. I hope you understand that the thought of redesigning the interface of an almost finished app really annoys me because it is really time-consuming.

Best regards

Thomas
Attachments
BBSProblem.zip (66 views, 181.00 KB)
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
What I expected (and what I did in another app is that, when I add a new record, grid and textboxes are synchronized, that means, that executing the add-code changes also to the new, still blank record in the grid. The new data is entered, after saving the grid points to the new record.


Strange, this is exactly what I got with your sample after I made the changes.

Glad you got it going!
Thomas Holste
Thomas Holste
StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)
Group: StrataFrame Users
Posts: 144, Visits: 618
Hi Ivan,

thanks a lot for your help. I checked your changes and they work but there is something left.

What I expected (and what I did in another app is that, when I add a new record, grid and textboxes are synchronized, that means, that executing the add-code changes also to the new, still blank record in the grid. The new data is entered, after saving the grid points to the new record.

I have added to the sample a second form, which is now the start-form, which does not utilize the link-menu, the panel-manager and panels. This is the way I use it in an other app (where it works fine) and here it works now to. I changed it back to my code, but with your changes it would work the same way (Except that you use ME.Add which, like I understand ist uses the form's primary business object but I will have some panels for maintaing data from different tables).

So to me it seems that the problem is not caused by my way of binding the controls (btw:. I took from the Business Binding Sample where the grid and a corresponding label are both bound via BBS) but by the link-manager/panel-combination. You will see that everything works fine on the new form2.

Best regards

Thomas
Attachments
BBSProblem.zip (77 views, 181.00 KB)
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hey Thomas. I had a look at it and posted here with some changes that made it work. Hope it helps.

Your textboxes were not bound the StrataFrame way. You were using the (DataBindings) and not setting the BusinessObject property nor the BindingField.

In your code, I changed places where you were dealing with the BBS, and set everything to the BO. Have a look at it and see if it makes sense to you, I have commented the lines where I changed things.

Also, I would like to recommend you to go through the Tutorials in the help file in case you haven't done so yet.
Attachments
BBSProblem.zip (68 views, 101.00 KB)
Thomas Holste
Thomas Holste
StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)
Group: StrataFrame Users
Posts: 144, Visits: 618
Hi Ivan,

sorry, I did not want to confuse you. The textboxes are bound by the Databindungs/Text-Property to the Business-Bindungs-Source. The problem is not with the textboxes, which are synchronized in the right way but with the BBS which does not refresh the controls (The grid and the textboxes too). When I execute the above described code, a new record is appended, but the current row does not change (In another app, which is a bit different, this code works fine). To illustrate this behaviour, I have made a little test-app which uses your database. Just click the "new"-button and see what happens.

Thanks a lot for your help

Thomas
Attachments
BBSProblem.zip (83 views, 156.00 KB)
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)Strategic Support Team Member (3.4K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Thomas Holste (9/5/2011)
yes, the textcontrols are bound to the bbs too.


Hi Thomas.

I am a bit confused here. Have you used the textboxes Properties window to set their BusinessObject property to a BusinessBindingSource? I think that is not possible. Do you think you could write a small sample using the StrataFrameSample database reproducing what you are trying to accomplish and post it here? This way we could take a look and try to help.
Thomas Holste
Thomas Holste
StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)StrataFrame User (356 reputation)
Group: StrataFrame Users
Posts: 144, Visits: 618
Hi Ivan,

in an older forum-message I found the hint to refresh the grid after the add, but this does not help too.

Best regards

Thomas
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search