Q About composite control
-
Hello, I created a composite control and one of the properties isn't initiating on the design mode and i get ,because of other function which uses this value, an error massage.
[Bindable(true), Category("Cells"), DefaultValue(typeof(Color),"White"), Description("The cells Color of the table")] public Color CellsColor { get { EnsureChildControls(); if (((object)ViewState["CellsColor"]) == null) return Color.White; return ((Color)ViewState["CellsColor"]); } set { EnsureChildControls(); if (value.IsSystemColor) DataGrid.ItemStyle.BackColor = Color.White; else DataGrid.ItemStyle.BackColor = (Color)value; ViewState["CellsColor"] = DGrec.ItemStyle.BackColor; } }
i get the error massage when i drag the control to a page for the first time, after i change the value in the property box also for the first time, the variable gets the proper value and the error massage clears so i can see the actual control in the design view. is someone familiar with the property initiation and why i get this error?