StrataFrame Forum

Custom business Binding Source

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

By Paul Chase - 8/19/2008

Just looking at this, is it not supposed to show up as a toolboxitem? I am going to work on integrating this into my report engine today and that is the first thing I noticed.
By Trent L. Taylor - 8/19/2008

By default, no.  You will want to add the ToolboxItem attribute to the classes that you create that you want to show up in the toolbox.

<ToolboxItem(True)> _
Public MyClass
    Inherits MicroFour.StrataFrame.Business.BusinessBindingSource(Of MyBOType)

End Class

By Paul Chase - 8/19/2008

Got it.. I had to add a custom attribute as well and for whatever reason VS wouldn't show it in the toolbox until i restarted VS i guess because i had just added the custom attribute class VS needed to reload I got no error or anything.  Well it works like it should now the custom BBS looks promising will let you know if i hit a wall , thanks
By Trent L. Taylor - 8/19/2008

Sounds good Smile
By Charles R Hankey - 8/19/2008

For lurkers



- for the attribute _ to work you must either import systems.componentmodel



or set the attribute as _



The component should appear after a rebuild unless there is another instance of VS open.


By Paul Chase - 8/19/2008

Hi Charles you are right about the toolbox visible attribute it lives in component model and thus i would need to import or directly reference that assembly to get that attribute to work. But I dont think the issue with the component not appearing was from not importing or referencing component model which i did Smile, I created a custom attribute that was housed in a seperate asembly in my solution for whatever reason VS would see everything fine i..e no compiler errors etc, but the component would not show up until I restarted VS. I'm 99% positive that the issue was due the the custom attribute being just recently added to the solution during that same session VS gets silly about things like that sometimes and make you go crazy so I restarted it and everything worked as it supposed to. I guess because the custom attribute was causing some kind of a problem the toolbox attribute was never getting evaluated thus no item in my toolbox.
By Charles R Hankey - 8/19/2008

I guess I should have mentioned my comment was only meant in keeping with my new policy of blurting out any blatantly obvious thing I find BigGrin hoping some lurker who hasn't run across that one yet might benefit from it. I would encourage others to do the same. ( I am also hoping it will benefit me when i forget i knew that and do a forum search for an answer - anybody read Sirens of Titan ? )



I benefited from your thread being here as the custom business binding source was shown in class last month, I thought I understood what was going on, then when I got home I couldn't find an example in the class examples, didn't see it in the toolbox and thought I might have dreamed the whole thing. (there was a lot of material to absorb)



Then while reading your question it hit me we were talking about adding a component to the solution and the wizard would set it up. I am still very new to this so I am looking for an example of where to use this outside of reporting.



I'm searching the help and forum and now for other posts on this, but if anyone has custom business binding samples, suggestions or tips feel free to throw them in here ...


By Charles R Hankey - 8/19/2008

Trent, how did you format the code block with the attribute in your message above? I tried quote codesnippet and double bracket and didn't get any content ??
By Dustin Taylor - 8/19/2008

You have to use "& lt;" (without the space) and "& gt;" (without the space) to get it to put the angle brackets. Otherwise it strips them Smile
By Charles R Hankey - 8/20/2008

< Cool! >




Thanks, Dustin Smile