HomeWeb Coding

Access Datagrid from member sub / function

Like Tweet Pin it Share Share Email

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.   

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
        CType(ctlInt, CheckBox).Checked 
End Sub

Comments (0)

Leave a Reply

Your email address will not be published. Required fields are marked *