opensubscriber
   Find in this group all groups
 
Unknown more information…

c : csharp.net@glengamoi.com 15 February 2006 • 12:14AM -0500

[CSharp.net] Unable to cast
by Thomas Bandt

REPLY TO AUTHOR
 
REPLY TO GROUP




Hi,

verstehe grade etwas nicht ... ich habe ein eigenes Objekt
"CategoryNode" was von TreeNode erbt.

public class CategoryNode : TreeNode
{

    private Guid categoryId;

    public Guid CategoryId
    {
        get { return categoryId; }
        set { categoryId = value; }
    }

}

So far so good. Damit befülle ich jetzt mein treeview-Control.
Nun möchte ich bei Auswahl die CategoryId haben:

private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
{
    CategoryNode node = (CategoryNode)e.Node;
    MessageBox.Show(node.CategoryId.ToString());
}

Aber: er kann schon gar nicht zu CategoryNode casten ... warum nicht?

Gruß, Th.

_______________________________________________
CSharp.net Mailingliste, Postings senden an:
CSharp.net@glen...
An-/Abmeldung und Suchfunktion unter:
http://www.glengamoi.com/mailman/listinfo/csharp.ne

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.