Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Collection editor problem

Collection editor problem

Scheduled Pinned Locked Moved ASP.NET
designhelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    Ujjaval Modi
    wrote on last edited by
    #1

    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.

    S 1 Reply Last reply
    0
    • U 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.

      S Offline
      S Offline
      Sandeep Akhare
      wrote on last edited by
      #2

      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... "

      U 1 Reply Last reply
      0
      • S Sandeep Akhare

        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... "

        U Offline
        U Offline
        Ujjaval Modi
        wrote on last edited by
        #3

        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; }

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups