Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Events Not Firing
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01443862
Message ID:
01444115
Views:
40
>>>>Your problem is here:
       public Collection<XLinkRow> Rows
>>>>        {
>>>>            get { return _Rows; }
>>>>            set 
>>>>            { 
>>>>                _Rows = value;
>>>>                _LoadRows();
>>>>            }
>>>>        }
You wire up the event handlers to an instance of Collection< XLinkRow > then replace it with another one. Needs a redesign really but you can use this instead:
public Collection<XLinkRow> Rows
>>>>        {
>>>>            get { return _Rows; }
>>>>            set 
>>>>            { 
>>>>                  _Rows.Clear();
>>>>                foreach (XLinkRow x in value)
>>>>                    Rows.Add(x);
>>>>            }
>>>>        }
>>>
>>>OHHHH. In the form when I do "xLinkList1.Rows = Rows;", it's cancelling out the event subscriptions.
>>>
>>>Wow. I would never have found that.
>>
>>Well - that's the problem but I don't think my solution works properly - looks like the list now doesn't show up in the Form...
>>Knocking off time I'm afraid - hope you have enough info to work out a proper solution.....
>
>I changed the property this way, and it works:
>
>
>private Collection<XLinkRow> _Rows = new Collection<XLinkRow>();
>public Collection<XLinkRow> Rows
>{
>    get { return _Rows; }
>    set 
>    {
>        _Rows = value;
>
>        _LoadRows();
>
>        _Rows.ItemAdded += _Rows_ItemAdded;
>        _Rows.ItemRemoved += _Rows_ItemRemoved;
>        _Rows.Cleared += _Rows_Cleared;
>    }
>}
>
It's not clear to me why you need to replace the collection. You could do this in the Form1 constructor:
for (int i = 0; i < 35; i++)
            {
                XLinkRow Row = new XLinkRow();
                Row.Name = "Row " + i.ToString();
                Row.Caption = "Row " + i.ToString();
                Row.Url = "www.Row" + i + ".com";
                xLinkList1.AddRow(Row);
            }
and just add a
_Rows.Add(Row);
to the AddRow() method. Given that you would only need default accessors to the Rows property.
Previous
Reply
Map
View

Click here to load this message in the networking platform