no need to check for the id, you can directly check if the control is a
datagrid:
for each control as Control in Page.Controls
if control is DataGrid then
dim grid as DataGrid = ctype(control, DataGrid)
'can use the grid and get hte id via grid.Id
end if
next
Controls are embedded however, so you need to recursively loop:
sub LookForGrid(Control Parent)
for each control as Control in Parent
if control is DataGrid then
dim grid as DataGrid = ctype(control, DataGrid)
'can use the grid and get hte id via grid.Id
end if
if control.HasControls then
LookForGrid(control)
end if
next
end sub
Karl