Latest News

  • Silverlight Online Chat
    Jul 24, 2010

    Today we launch the new Silverlight Live Chat application demonstrating the Liquid RichTextBox and Emoticon replacements.

  • New Super Shoot Em Up 2 Game
    Jun 29, 2010

    Added to the Games section is the new Super Shoot 'Em Up 2 game. Take control of your tank with the aim to defeat the computer controlled opponents. Features all new weapons, levels and Battle Mode!

  • Silverlight 4 Controls V5.3.2 Released
    Jun 28, 2010

    This release contains several fixes raised in the forums.

  • New Sandmania Puzzle Game
    Jun 18, 2010

    Sandmania is the latest game from vectorlight, the aim of this game is to guide sand from the top of the screen to the various colored containers below.

  • New Moon Tower Defense Game
    May 29, 2010

    Added to the Games section is the new Moon Tower Defense game. Defend the Moon from the circling Aliens and Humans.

charly
charly
Populate??? Expand??? expanded??? Posted: Mar 01, 2010
 

I have the following code:

if (cctx.IsLoading) return;

            EntitySet<Materias> entidad = (EntitySet<Materias>)sender;

            List<Materias> mats = entidad.ToList();

            CETreeView.Clear();

            //ObservableCollection<Node> nodos = new ObservableCollection<Node>();

            foreach (Materias item in mats)

            {

                Node nodoActual = new Node("" + item.IdMateria, item.Descripcion, true);

                nodoActual.Tag = item;

                nodoActual.ChildrenLoaded=false;

                nodoActual.PopulateChildren += new TreeEventHandler(Materias_NodeExpanded);

                CETreeView.Nodes.Add(nodoActual);

            }

            

            Cursor = Cursors.Arrow;

I want that the node reaches the Materias_NodeExpanded when i expand the node in order to get their childs (not to charge all of them from the beggining), i already tried with PopulateChildren, Expanded, Expand events but the code of Materias_NodeExpanded is not being executed. What's the right way to do it?

 
 
charly
charly
RE: Populate??? Expand??? expanded??? Posted: Mar 02, 2010
 

The problems is that when i add a new Node to the existing node all the NodeExpand Event becames null, the workaround can be (and that's the way i am doing it now to set the NodeExpand at the end of the process, so no new nodes will be in the Nodes collection and the eventhandler will not be updated to null...