out of the foreach, try
CommandField c = new CommandField();
c.ShowEditButton = true;
c.Columns.Add(c);
                  michele
                   2009-08-24 15:37:00
                
              out of the foreach, try
CommandField c = new CommandField();
c.ShowEditButton = true;
c.Columns.Add(c);