Access Datagrid from member sub / function
Code sample to access Datagrid values from another member sub / function apart from Datagrid events.
Private Sub temp
Dim dgi As DataGridItem
‘dgdFormTypes is the id for Datagrid.
For Each dgi In dgdFormTypes.Items
Code = dgi.Cells(4).Text
Name = dgi.Cells(5).Text ‘If Datagrid has some Control in any column then
Dim ctlInt As Control = dgi.Cells(1).FindControl(“chkInt”) ‘ Get the value of that Control, in this case its a Checkbox