Index: plugins/views_plugin_style.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/plugins/views_plugin_style.inc,v
retrieving revision 1.5.2.2
diff -u -p -r1.5.2.2 views_plugin_style.inc
--- plugins/views_plugin_style.inc	25 Jun 2009 18:48:25 -0000	1.5.2.2
+++ plugins/views_plugin_style.inc	17 Aug 2009 21:31:37 -0000
@@ -152,11 +152,13 @@ class views_plugin_style extends views_p
     // Render each group separately and concatenate.  Plugins may override this
     // method if they wish some other way of handling grouping.
     $output = '';
+    $this->view->row_index = 0;
     foreach ($sets as $title => $records) {
       if ($this->uses_row_plugin()) {
         $rows = array();
         foreach ($records as $label => $row) {
           $rows[] = $this->row_plugin->render($row);
+          $this->view->row_index++;
         }
       }
       else {
@@ -165,6 +167,7 @@ class views_plugin_style extends views_p
 
       $output .= theme($this->theme_functions(), $this->view, $this->options, $rows, $title);
     }
+    unset($this->view->row_index);
     return $output;
   }
 
@@ -182,6 +185,7 @@ class views_plugin_style extends views_p
   function render_grouping($records, $grouping_field = '') {
     $sets = array();
     if ($grouping_field) {
+      $this->view->row_index = 0;
       foreach ($records as $row) {
         $grouping = '';
         // Group on the rendered version of the field, not the raw.  That way,
@@ -189,12 +193,14 @@ class views_plugin_style extends views_p
         // the admin or theme layer or anywhere else we'd like.
         if (isset($this->view->field[$grouping_field])) {
           $grouping = $this->view->field[$grouping_field]->theme($row);
+          $this->view->row_index++;
           if ($this->view->field[$grouping_field]->options['label']) {
             $grouping = $this->view->field[$grouping_field]->options['label'] . ': ' . $grouping;
           }
         }
         $sets[$grouping][] = $row;
       }
+      unset($this->view->row_index);
     }
     else {
       // Create a single group with an empty grouping field.
Index: theme/theme.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/theme/theme.inc,v
retrieving revision 1.73.2.5
diff -u -p -r1.73.2.5 theme.inc
--- theme/theme.inc	1 Jul 2009 22:52:42 -0000	1.73.2.5
+++ theme/theme.inc	17 Aug 2009 21:31:37 -0000
@@ -306,7 +306,9 @@ function template_preprocess_views_view_
     foreach ($keys as $id) {
       $renders[$count][$id] = $view->field[$id]->theme($row);
     }
+    $view->row_index = $count;
   }
+  unset($view->row_index);
 
   foreach ($columns as $field => $column) {
     // render the header labels
