tags:

views:

27

answers:

1

My main form in my application has a datagrid view that can have 1 to many user selected inputs. Column 8 of this grid is for the user to input "time in minutes." I have a separate class where I have built a timer that counts down from whatever time the user specifies down to 0. What I need is to create a series of alarms that go off as the timer counts down that are triggered by the user input values in column 8 of my datagrid.

I think the best way to do this is to build a list<> from the values in the datagrid. I for whatever reason can't quite figure out how to get the values from the datagrid in to a list<> in my other class.

Hopefully I explained in a way that makes sense.

+1  A: 

Just did this off the top of my head

List<int> listOfMinutes = new List<int>();

for (int i = 0;i < dataGridView1.Rows.Count; i++)
{
    // either ".Text" or ".Value"...can't remember
    listOfMinutes.Add(int.Parse(dataGridView1.Rows[i].Cells[7].Text));
}

That should give you a list of the data in Column 8. This is assuming you mean Column 8 when looking at the Grid.

Eclipsed4utoo
that's right along the lines of what I've been trying, but I didn't quite have it right. I'm going to give this a go here. Thanks!
EvanRyan