Problem with adding new record


Author
Message
Thomas Holste
Thomas Holste
Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)
Group: StrataFrame Users
Posts: 144, Visits: 618
Hi there,

in an app I have a panel with a toolstrip (and some toolstrip-buttons), a datagridview and some textboxes.

There is a BO (called MessidentBO) and a Business Binding Source to which the BO ist bound. The BBS is used as datasource for the datagridview and the textboxes. In the cmdNew-Button I have the following code:



Me.lEditmode = True

Me.DGVWL.Enabled = False  ' Datagridview disabled

Me.cmdwlneu.Enabled = False

Me.cmdwledit.Enabled = False

Me.cmdwlsave.Enabled = True

Me.cmdwlundo.Enabled = True

Me.cmdwldelete.Enabled = False

Me.bbsmessident.BusinessObject.Add()

Me.bbsmessident.BusinessObject.Edit()

Me.TGBWL.Enabled = True  ' Themed Group Box Enabled where the textboxes reside

Me.TxtMIIdent.Focus()



But this does not work. A new record is append, but the "record pointer" (If I can use this term) is not set to the new record but stays on the one selected in the Grid.

What really makes me wondering, is that I use the same kind of code in another app and there it works fine!

I've been comparing the two pieces of code and the properties of the used elements but I can not find the difference.

Has anybody a tip for me what I might have been missing?

Thanks in advance

Thomas
Replies
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K 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
Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 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 (96 views, 181.00 KB)
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K 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 (114 views, 783.00 KB)
Thomas Holste
Thomas Holste
Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 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 (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Glad it helped, Thomas. http://forum.strataframe.net/Skins/Classic/Images/EmotIcons/Cool.gif
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Thomas Holste - 14 Years Ago
Ivan George Borges - 14 Years Ago
Thomas Holste - 14 Years Ago
Ivan George Borges - 14 Years Ago
Thomas Holste - 14 Years Ago
                         Hey Thomas. I had a look at it and posted here with some changes that...
Ivan George Borges - 14 Years Ago
                             Hi Ivan, thanks a lot for your help. I checked your changes and they...
Thomas Holste - 14 Years Ago
                                 [quote]What I expected (and what I did in another app is that, when I...
Ivan George Borges - 14 Years Ago
                                     Hi Ivan, sorry to say but I haven't got it going. My sample just...
Thomas Holste - 14 Years Ago
                                         Hi Thomas. Find attached a video of your first sample, with the...
Ivan George Borges - 14 Years Ago
                                             Hi Ivan, thanks for your help. At first it did not work but after...
Thomas Holste - 14 Years Ago
                                                 Glad it helped, Thomas.
Ivan George Borges - 14 Years Ago
Thomas Holste - 14 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search