﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » Problem with adding new record</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Wed, 20 May 2026 22:13:27 GMT</lastBuildDate><ttl>20</ttl><item><title>Problem with adding new record</title><link>http://forum.strataframe.net/FindPost30294.aspx</link><description>Hi there,&lt;br/&gt;&lt;br/&gt;in an app I have a panel with a toolstrip (and some toolstrip-buttons), a datagridview and some textboxes.&lt;br/&gt;&lt;br/&gt;There is a BO (called MessidentBO) and a Business Binding Source&amp;nbsp;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:&lt;br/&gt;&lt;br/&gt;[code]&lt;br/&gt;&lt;br/&gt;&lt;font size=2 face=Consolas&gt;&lt;font size=2 face=Consolas&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;Me&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2 face=Consolas&gt;&lt;font size=2 face=Consolas&gt;.lEditmode = &lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;True&lt;br/&gt;&lt;br/&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2 face=Consolas&gt;&lt;font size=2 face=Consolas&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;Me&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2 face=Consolas&gt;&lt;font size=2 face=Consolas&gt;.DGVWL.Enabled = &lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;False&amp;nbsp; ' Datagridview disabled&lt;br/&gt;&lt;br/&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2 face=Consolas&gt;&lt;font size=2 face=Consolas&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;Me&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2 face=Consolas&gt;&lt;font size=2 face=Consolas&gt;.cmdwlneu.Enabled = &lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;False&lt;br/&gt;&lt;br/&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2 face=Consolas&gt;&lt;font size=2 face=Consolas&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;Me&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2 face=Consolas&gt;&lt;font size=2 face=Consolas&gt;.cmdwledit.Enabled = &lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;False&lt;br/&gt;&lt;br/&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2 face=Consolas&gt;&lt;font size=2 face=Consolas&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;Me&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2 face=Consolas&gt;&lt;font size=2 face=Consolas&gt;.cmdwlsave.Enabled = &lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;True&lt;br/&gt;&lt;br/&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2 face=Consolas&gt;&lt;font size=2 face=Consolas&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;Me&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2 face=Consolas&gt;&lt;font size=2 face=Consolas&gt;.cmdwlundo.Enabled = &lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;True&lt;br/&gt;&lt;br/&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2 face=Consolas&gt;&lt;font size=2 face=Consolas&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;Me&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2 face=Consolas&gt;&lt;font size=2 face=Consolas&gt;.cmdwldelete.Enabled = &lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;False&lt;br/&gt;&lt;br/&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2 face=Consolas&gt;&lt;font size=2 face=Consolas&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;Me&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2 face=Consolas&gt;&lt;font size=2 face=Consolas&gt;.bbsmessident.BusinessObject.Add()&lt;br/&gt;&lt;br/&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;Me&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2 face=Consolas&gt;&lt;font size=2 face=Consolas&gt;.bbsmessident.BusinessObject.Edit()&lt;br/&gt;&lt;br/&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;Me&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2 face=Consolas&gt;&lt;font size=2 face=Consolas&gt;.TGBWL.Enabled = &lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;True&amp;nbsp; ' Themed Group Box Enabled where the textboxes reside&lt;br/&gt;&lt;br/&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2 face=Consolas&gt;&lt;font size=2 face=Consolas&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;Me&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2 face=Consolas&gt;&lt;font size=2 face=Consolas&gt;.TxtMIIdent.Focus()&lt;br/&gt;&lt;br/&gt;&lt;/font&gt;&lt;/font&gt;[/code]&lt;br/&gt;&lt;br/&gt;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.&lt;br/&gt;&lt;br/&gt;What really makes me wondering, is that I use the same kind of code in another app and there it works fine!&lt;br/&gt;&lt;br/&gt;I've been comparing the two pieces of code and the properties of the used elements but I can not find the difference. &lt;br/&gt;&lt;br/&gt;Has anybody a tip for me what I might have been missing?&lt;br/&gt;&lt;br/&gt;Thanks in advance&lt;br/&gt;&lt;br/&gt;Thomas</description><pubDate>Thu, 08 Sep 2011 10:58:52 GMT</pubDate><dc:creator>Thomas Holste</dc:creator></item><item><title>RE: Problem with adding new record</title><link>http://forum.strataframe.net/FindPost30334.aspx</link><description>Glad it helped, Thomas. &lt;img src="http://forum.strataframe.net/Skins/Classic/Images/EmotIcons/Cool.gif" alt="http://forum.strataframe.net/Skins/Classic/Images/EmotIcons/Cool.gif" /&gt;</description><pubDate>Thu, 08 Sep 2011 10:58:52 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: Problem with adding new record</title><link>http://forum.strataframe.net/FindPost30333.aspx</link><description>Hi Ivan,&lt;br/&gt;&lt;br/&gt;thanks for your help. At first it did not work but after changing&lt;br/&gt;&lt;br/&gt;dgvkunden.CurrentCell = dgvkunden.Item(0, dgvkunden.Rows.Count - 2)&lt;br/&gt;&lt;br/&gt;to&lt;br/&gt;&lt;br/&gt;dgvkunden.CurrentCell = dgvkunden.Item(0, dgvkunden.Rows.Count - 1)&lt;br/&gt;&lt;br/&gt;it works really fine&lt;br/&gt;&lt;br/&gt;Best regards&lt;br/&gt;&lt;br/&gt;Thomas</description><pubDate>Thu, 08 Sep 2011 10:23:53 GMT</pubDate><dc:creator>Thomas Holste</dc:creator></item><item><title>RE: Problem with adding new record</title><link>http://forum.strataframe.net/FindPost30332.aspx</link><description>Hi Thomas.&lt;br/&gt;&lt;br/&gt;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&amp;nbsp;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&amp;nbsp;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. &lt;br/&gt;&lt;br/&gt;This is how I navigated your grid:&lt;br/&gt;&lt;br/&gt;[codesnippet]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- navigate the Grid&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dgvkunden.CurrentCell = dgvkunden.Item(0, dgvkunden.Rows.Count - 2)[/codesnippet]&lt;br/&gt;&lt;br/&gt;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.&lt;br/&gt;&lt;br/&gt;Cheers.</description><pubDate>Thu, 08 Sep 2011 07:41:03 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: Problem with adding new record</title><link>http://forum.strataframe.net/FindPost30331.aspx</link><description>Hi Ivan,&lt;br/&gt;&lt;br/&gt;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?&amp;nbsp;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&amp;nbsp;the interface of an almost finished app really annoys me because it is really time-consuming.&lt;br/&gt;&lt;br/&gt;Best regards&lt;br/&gt;&lt;br/&gt;Thomas</description><pubDate>Thu, 08 Sep 2011 03:11:30 GMT</pubDate><dc:creator>Thomas Holste</dc:creator></item><item><title>RE: Problem with adding new record</title><link>http://forum.strataframe.net/FindPost30330.aspx</link><description>[quote]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.[/quote]&lt;br/&gt;&lt;br/&gt;Strange, this is exactly what I got with your sample after I made the changes.&lt;br/&gt;&lt;br/&gt;Glad you got it going!</description><pubDate>Wed, 07 Sep 2011 16:10:25 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: Problem with adding new record</title><link>http://forum.strataframe.net/FindPost30327.aspx</link><description>Hi Ivan,&lt;br/&gt;&lt;br/&gt;thanks a lot for your help. I checked your changes and they work but there is something left.&lt;br/&gt;&lt;br/&gt;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.&lt;br/&gt;&lt;br/&gt;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&amp;nbsp;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).&lt;br/&gt;&lt;br/&gt;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.&lt;br/&gt;&lt;br/&gt;Best regards&lt;br/&gt;&lt;br/&gt;Thomas</description><pubDate>Wed, 07 Sep 2011 13:46:37 GMT</pubDate><dc:creator>Thomas Holste</dc:creator></item><item><title>RE: Problem with adding new record</title><link>http://forum.strataframe.net/FindPost30322.aspx</link><description>Hey Thomas. I had a look at it and posted here with some changes that made it work. Hope it helps.&lt;br/&gt;&lt;br/&gt;Your textboxes were not bound the StrataFrame way. You were using the (DataBindings) and not setting the BusinessObject property nor the BindingField.&lt;br/&gt;&lt;br/&gt;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.&lt;br/&gt;&lt;br/&gt;Also, I would like to recommend you to go through the Tutorials in the help file in case you haven't done so yet.</description><pubDate>Wed, 07 Sep 2011 10:23:48 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: Problem with adding new record</title><link>http://forum.strataframe.net/FindPost30316.aspx</link><description>Hi Ivan,&lt;br/&gt;&lt;br/&gt;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.&lt;br/&gt;&lt;br/&gt;Thanks a lot for your help&lt;br/&gt;&lt;br/&gt;Thomas</description><pubDate>Wed, 07 Sep 2011 05:48:27 GMT</pubDate><dc:creator>Thomas Holste</dc:creator></item><item><title>RE: Problem with adding new record</title><link>http://forum.strataframe.net/FindPost30312.aspx</link><description>[quote][b]Thomas Holste (9/5/2011)[/b][hr]yes, the textcontrols are bound to the bbs too.[/quote]&lt;br/&gt;&lt;br/&gt;Hi Thomas.&lt;br/&gt;&lt;br/&gt;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.</description><pubDate>Tue, 06 Sep 2011 17:39:52 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: Problem with adding new record</title><link>http://forum.strataframe.net/FindPost30304.aspx</link><description>Hi Ivan,&lt;br/&gt;&lt;br/&gt;in an older forum-message I found the hint to refresh the grid after the add, but this does not help too.&lt;br/&gt;&lt;br/&gt;Best regards&lt;br/&gt;&lt;br/&gt;Thomas</description><pubDate>Tue, 06 Sep 2011 04:45:34 GMT</pubDate><dc:creator>Thomas Holste</dc:creator></item><item><title>RE: Problem with adding new record</title><link>http://forum.strataframe.net/FindPost30303.aspx</link><description>Hi Ivan,&lt;br/&gt;&lt;br/&gt;yes, the textcontrols are bound to the bbs too. And in one of two cases (I have 2 panels with the&lt;br/&gt;&lt;br/&gt;same functionality, but for different BOs) the BO is the primary BO of the form.&lt;br/&gt;&lt;br/&gt;Best regards&lt;br/&gt;&lt;br/&gt;Thomas</description><pubDate>Mon, 05 Sep 2011 11:47:10 GMT</pubDate><dc:creator>Thomas Holste</dc:creator></item><item><title>RE: Problem with adding new record</title><link>http://forum.strataframe.net/FindPost30297.aspx</link><description>Hi Thomas.&lt;br/&gt;&lt;br/&gt;Is the BO the form's primary business object? Are the text controls bound to the BO?</description><pubDate>Thu, 01 Sep 2011 17:04:02 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item></channel></rss>