View Single Post
Old 09-02-2011, 05:06 PM  
tical
Confirmed User
 
Join Date: Feb 2002
Location: Las Vegas
Posts: 6,504
here you go, just remove/replace the temporary stuff w/ your stuff

Code:
            List<string> listId = new List<string>();
            List<string> listCell = new List<string>();
            listId.Add("id1");
            listId.Add("id2");
            listId.Add("id3");
            listId.Add("id4");
            listId.Add("id5");
            listId.Add("id6");
            listCell.Add("cell1");
            listCell.Add("cell2");
            listCell.Add("cell3");
            listCell.Add("cell4");

            int listCellCounter = 0;
            for (int x = 0; x < listId.Count; x++)
            {
                Debug.WriteLine("something " + listId[x] + " " + listCell[listCellCounter]);
                if (listCellCounter == listCell.Count() -1)
                {
                    listCellCounter = 0;
                }
                else
                {
                    listCellCounter += 1;
                }
            }
output looks like this:

something id1 cell1
something id2 cell2
something id3 cell3
something id4 cell4
something id5 cell1
something id6 cell2
__________________
112.020.756
tical is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote