Help understanding BrowseDialog inheritance


Author
Message
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
I have a base BrowseDialog I want to use in other similar forms that share the same search table but with different fields. Ok I created my base class BDBase and setup all possible search fields in SearchFields property and also setup the BrowseResultsLayout.



So far so good. Now I create another class and inherited from BDBase and in the designer, I removed the fields I don't need from SearchFields and BrowseResultsLayout. When I add an instance of this class in my form, those 2 properties are reset to the default values in BDBase class.



What am I doing wrong? Also is this the correct approach to reuse the BrowseDialog?

Edhy Rijo

Replies
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Edhy,



Keep this one thing in mind and it should make things easier...these are just properties, classes, and collections. 100% of the control can be dynamically set and rebuilt to your liking. This is the same thing that is done via the type editors, but in your case, you would just be doing this manually.





1.- When controlling the SearchFields like this, the layout will not be properly fit, so an space will be left between the SearchFields and the ListView, is there a way to control that too? see attached image.




Yup...just set the FormLayout property to whatever you like in code:



Me.FormLayout.LeftSplitterDistance = 100




This is the property that you will set in the example that you gave. Even though it is called LeftSplitterDistance, it is used for the Top and Bottom as well.





2.- As for the BrowseResultLayout, could you provide a quick sample code of how to remove one columns from the listview?





Me.BrowseResultsLayout.BrowseColumns.Clear()



Me.BrowseResultsLayout.DisplayFieldNames.Clear()

Me.BrowseResultsLayout.DisplayFieldNames.Add("cust_Company")



Dim bc As New MicroFour.StrataFrame.UI.Windows.Forms.BrowseColumnItem()

bc.ColumnHeaderText = "Company"

bc.ColumnHeaderWidth = 200

bc.ColumnTextAlignment = Windows.Forms.HorizontalAlignment.Left

bc.FormatString = "{0}"



Me.BrowseResultsLayout.BrowseColumns.Add(bc)

Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Trent L. Taylor (08/10/2009)
Edhy, keep this one thing in mind and it should make things easier...these are just properties, classes, and collections. 100% of the control can be dynamically set and rebuilt to your liking. This is the same thing that is done via the type editors, but in your case, you would just be doing this manually.




Thanks again, Trent. Wow, this is just great to have such control over the BD and opens up a whole new ideas on how to build my applications, very cool things can be done with the BrowseDialog control. Thanks a lot for the sample code.


Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
No problem...Glad to help! Smile
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Edhy Rijo - 16 Years Ago
Edhy Rijo - 16 Years Ago
Trent L. Taylor - 16 Years Ago
Edhy Rijo - 16 Years Ago
Trent L. Taylor - 16 Years Ago
                         [quote][b]Trent L. Taylor (08/04/2009)[/b][hr]In fact, you may want to...
Edhy Rijo - 16 Years Ago
                             [quote]Is there a way to overcome this, other than have a BD for each...
Trent L. Taylor - 16 Years Ago
                                 Hi Trent,

I am setting up a simple sample that will show...
Edhy Rijo - 16 Years Ago
                                     Hi Trent,

Attached please find the requested Sample. It is...
Edhy Rijo - 16 Years Ago
                                         Ok, you can take several routes on this, but here is my suggestion and...
Trent L. Taylor - 16 Years Ago
                                             Thanks a lot Trent, that is exactly the type of control I want to have...
Edhy Rijo - 16 Years Ago
                                                 Edhy,

Keep this one thing in mind and it should make things...
Trent L. Taylor - 16 Years Ago
                                                     [quote][b]Trent L. Taylor (08/10/2009)[/b][hr]Edhy, keep this one...
Edhy Rijo - 16 Years Ago
                                                         No problem...Glad to help! :)
Trent L. Taylor - 16 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search