Here is how you should be able to do it.
(I created the example assuming you need to show some selected
Person
objects in the
GridView
). You just need to change the following code according to your need:
private void LoadPersons()
{
List<Person> persons = new List<Person>();
foreach (TreeNode node in TreeView1.CheckedNodes)
{
string Value = node.Value;
int Id = Convert.ToInt32(Value);
string Text = node.Text;
string path = node.ValuePath;
Person person = GetPersonById(Id);
if (person != null)
{
persons.Add(person);
}
}
GridView1.DataSource = persons;
GridView1.DataBind();
}