Autor Beitrag
Nuckey
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 78



BeitragVerfasst: Sa 03.09.11 08:14 
ein fröhliches hallo !
zur zeit beschäftige ich mich mit dehm thema steuerelemente und databinding.
komme auch sooweit ganz gut vorran,bis auf ein kleines problem.

ich möchte eine treenodecollection ,die Count eigenschaft an ein label binden,
bisher hatte ich dieses probiert
ausblenden C#-Quelltext
1:
2:
3:
TreeNodeCollection node = treeView1.Nodes;
Binding bi = new Binding("Text", node, "Count");
label1.DataBindings.Add(bi);

und dieses
ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
TreeNodeCollection node = treeView1.Nodes;
Binding bi = new Binding("Text", node, "Count",true);
bi.Format += new ConvertEventHandler(bi_Format);
label1.DataBindings.Add(bi);
.
.
.
 private void bi_Format(object sender, ConvertEventArgs e)
        {
            e.Value = String.Format("Count : {0}", node.Count);

        }

leider sagt mir visualstudio das er Count nicht findet,was mache ich falsch ?

mfg nuckey

Moderiert von user profile iconChristian S.: Code- durch C#-Tags ersetzt