Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
160
Windows Form Inheritence with WinGrid Control
posted

I have an application where many tables are used to drive data in the application itself. These tables need some basic CReate, Update and Delete functionality for which the WinGrid control is of great utility.

Each table needs to provide some basis functionality like print out of the data in the database plus some other odds and ends. But each table needs to provide this. To help reduce code, I created a base class that inherits from Windows Form and place a Print button, Binding Navigator and the WinGrid control on it. The WinGrid is NOT bound to any data source.

I now inherit from my base Windows Form class with the controls and try to configure the WinGrid to bind to the specific data source it will work with. My problem is that the configuration of the WinGrid is not saving properly. In other words, I will set the data source yet none of the data is fetched. I will set the appearance of certain cells and appearance does not appear during runtime.

In trouble shooting this issue, I did come across the fact my WinGrid was a Private member of the base class. I changed this to Protected so the inherited class would have access. I now see some of the designer customization in the inherited class but I’m still having trouble accessing the data but I see the “columns” now but without the desired appearance.

Are there issues that I need to be aware of when inheriting a Form with WinGrid control on it?

Any help would be greatly appreciated.

 Regards,

Aditya

Parents Reply Children
No Data