Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_professional thread: Programmatically Ttraversing Templated Data Grid


Message #1 by "Gary Grosso" <congjg@n...> on Tue, 22 Oct 2002 13:45:14
I want to be able to read and process all items on my data grid without 
using the built in row by row editing of the data grid.
I have a  templated grid that opens up with n... records loaded and 
displayed in their corresponding controls within the grid (textbox, 
dropdownlsit etc)
I want to be able to traverse the grid row by row, cell by cell, 
extracting and converting the data. I can do this fairly easily with a 
data bound (non templated) grid, as the code below demonstrates.

Dim ItemRow As DataGridItem
Dim ItemColumn As DataGridColumn
        Dim ColumnCounter As Integer
        For Each ItemRow In Datagrid21.Items
            For ColumnCounter = 0 To ItemRow.Cells.Count - 1
                '' CODE FOR EACH VALUE
            Next ColumnCounter
             '' CODE FOR EACH ROW
        Next ItemRow

But I can not seem to find a suitable way to accomplish this with a 
templated grid. Any suggestions?

  Return to Index