none
Forcing a component to use default colors RRS feed

  • Question

  • I have a component that I've written for the gridview that sets the grid up using default colors and such that I want to use throughout the application.  The thought was also that later, if I wanted to change the colors I could modify my component and flush those changes down through all the forms that used it.

     

    However, I've noticed that once the component is dropped onto a form, all the default functions are gone.  They setup correctly the moment it was dropped but if I wanted to change the component for say the default header color, it will drop onto a new form correctly but all those old grids I dropped won't update.  They keep their default values from the first day I dropped them.

     

    Can anyone suggest a way to deal with this to get the functionality that I'm looking for?

     

    Thanks,

     

    glenn

    Sunday, April 1, 2007 1:18 PM

Answers

  • Unfortunately, the IDE will still see your modifications as manual changes and it will create entries in the InitialComponents(). If you remove these related entries it should give you back your custom settings.

     

    To actually propagate these changes, you will need to define properties corresponding to the datagrid properties that you want to customize.

    Monday, April 2, 2007 8:33 PM

All replies

  • You're not saying what you did in your component to change the default colors.  I'm guessing that you didn't override the set accessor, just the default value with the constructor.  The color is now controlled by the code in InitializeComponent().
    Monday, April 2, 2007 8:23 AM
    Moderator
  • Yes, I have the code in the components constructor... Should I have put it somewhere else?

     

    Thanks,

     

    glenn

    Monday, April 2, 2007 7:57 PM
  • Unfortunately, the IDE will still see your modifications as manual changes and it will create entries in the InitialComponents(). If you remove these related entries it should give you back your custom settings.

     

    To actually propagate these changes, you will need to define properties corresponding to the datagrid properties that you want to customize.

    Monday, April 2, 2007 8:33 PM