Collection editor problem
-
i had made one integer type collection editor in web control library project. the collection gets displayed properly at design time and i am able to add and remove items also but my problem is that value entered at design time does not effect the control at runtime. Regards, Ujjaval Modi.
-
i had made one integer type collection editor in web control library project. the collection gets displayed properly at design time and i am able to add and remove items also but my problem is that value entered at design time does not effect the control at runtime. Regards, Ujjaval Modi.
Best thing is debug your control by putting break points at proper places. Can't make any conclusion as we don't know what you have coded for the same
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
-
Best thing is debug your control by putting break points at proper places. Can't make any conclusion as we don't know what you have coded for the same
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
I have tried debugging the application by putting breakpoints. Here's the code : First of all I designed a class for creating a List Collection : using System; using System.Collections.Generic; using System.Text; using System.Collections; namespace Funnel { public class SectionValue : CollectionBase { public double this[int index] { get { return ((double)List[index]); } set { List[index] = value; } } public int Add(double value) { return (List.Add(value)); } public int Add(string value) { try { double c = Convert.ToDouble(value); return (List.Add(c)); } catch (Exception) { throw new ArgumentException(string.Format( "Error converting the given string '{0}' to a color", value), "value"); } } public bool Contains(double value) { // If value is not of type Color, this will return false. return (List.Contains(value)); } public int IndexOf(double value) { return (List.IndexOf(value)); } public void Insert(int index, double value) { List.Insert(index, value); } public void Remove(double value) { List.Remove(value); } public SectionValue(double[] sections) : base() { foreach (double s in sections) { this.Add(s); } } public SectionValue() : base() {} } } Then I use object of the class in my control as follows : protected SectionValue m_SectionValue; and write property for it as follows : [Bindable(true) , Category("Appearance") , Browsable(true) , PersistenceMode(PersistenceMode.Attribute) , DesignerSerializationVisibility(DesignerSerializationVisibility.Content) ] public SectionValue UserDefinedSection { get { if (m_SectionValue == null) m_SectionValue = new SectionValue(); return m_SectionValue; } set { m_SectionValue = value; }