ASP GridView List

If I wanted to add a new item to a <List> with the Data key name from a gridview how would I go about doing it?

Example.

List<myClass> myList  = new List<myClass>();

myList.add(new myClass(*//The value of the data key name that has been clicked*));

A user might click on another item so it would be repeated etc etc.

Answers


@Brian: Check it out:

    protected void dataGridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
    {   
        if(myList == null)        
          myList = new List<myClass>();
        foreach (object keys in dataGridView1.DataKeys[e.NewSelectedIndex].Values)
        {
            myList.Add(keys);
        }            
    }

Need Your Help

Problems with zend and htaccess

php .htaccess zend-framework shared-hosting

I'm trying to make a Zend application on a shared webhost, I have no access to php.ini or anything.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.