StrataFrame Forum

WinForms UserControl not refreshing bound control.

http://forum.strataframe.net/Topic21679.aspx

By Alan P Bourke - 1/26/2009

I have a UserControl that implements MicroFour.StrataFrame.UI.Windows.Forms.UserControl.

On that UserControl I have a BO, and a textbox bound to that BO in the normal way. In the UserControl Load event I have a call to FillDataTable() .

I also have a testbed project with a form that uses the control.

The problem is when I run the testbed project the form comes up and displays the first record in the textbox, however the textbox is disabled. If I place a MaintenanceFormToolStrip either on the UserControl itself, or the test form that hosts the UserControl, it does not seem to connect to the BO as the buttons on the strip don't change the textbox.

Also, if I place my own button on the UserControl and use that to call MoveNext() on the BO, I can see the CurrentRowIndex changing, but the textbox just stays as is.

I suspect I'm interpreting what I should be doing here incorrectly - any pointers?

TIA ...

By Alan P Bourke - 1/26/2009

I should add that the call to FillDataTable() is "select * from mytable" i.e. it will be returning more that one record.
By Edhy Rijo - 1/27/2009

Hi Alan,

Take a look at the StrataFlix sample application specifically at these items:

  • StrataFlix.UI PeopleLookupControl.vb user control
  • StataFlix CastMemberSelection.vb form

There you have a live sample of a user control and how to manage it in a regular form.  I personally have not used that feature so I may not be able to get deeper in this topic.

By Alan P Bourke - 1/27/2009

Thanks. That looks fairly complicated Sad
By Edhy Rijo - 1/27/2009

Forgot to mention, do a search in the forum for "UserControl" that will give you several hits, and your answer should be there. 

I have found with SF that once you understand the "How to", things that looks complicated, are in fact very easy to accomplish.

By Alan P Bourke - 1/27/2009

Aha! As simple as setting up the Business Object Translation!



Don't see it in the help file though ...



Thanks.
By Edhy Rijo - 1/27/2009

Great!, glad you found it.
By Trent L. Taylor - 1/28/2009

Yeah, that is exactly what that is for.  I will make a note of the help and make sure it gets in there.