Dec 21, 2012 at 4:53 PM
Edited Dec 21, 2012 at 7:31 PM
I'm not sure I understand the problem you need to solve or what your code is doing. I'll assume, based on your discussion title, that you need to retrieve the name of the group a vertex belongs to when that vertex is clicked.
One way to do that is the following:
1. In the code that puts vertices into groups, store the group name within each vertex object. You can do that with the IVertex.SetValue() method, which allows you to store arbitrary key/value pairs on the vertex. For example:
2. In the NodeXLControl.VertexClick event handler, retrieve the value that you stored on the vertex:
if ( e.Vertex.TryGetValue("GroupName", out groupNameAsObject) )
Do something with (String)groupNameAsObject;
If that's not what you're asking, let me know.