Script(s)

what I learn is what u c

Access Datagrid from member sub / function

leave a comment »

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

Advertisements

Written by gchandra

March 6, 2006 at 8:37 pm

Posted in Web Coding

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: