Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get text value from datagrid cell on webform
Message
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
WebForms
Titre:
How to get text value from datagrid cell on webform
Divers
Thread ID:
00678234
Message ID:
00678234
Vues:
56
I used some code that from the MSDN library for the DataGrid1_ItemDataBound to make it so the user can click anywhere to select a row in my datagrid. When they click (SelectedIndexChanged), I want to capture the value in the second cell of the row they clicked on. Anybody know how to get that?

Thanks
Kirk

Here is the code I'm using in the DataGrid1_ItemDataBound
Private Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles DataGrid1.ItemDataBound
        Dim itemType As ListItemType = e.Item.ItemType
        If ((itemType = ListItemType.Pager) Or (itemType = ListItemType.Header) Or (itemType = ListItemType.Footer)) Then
            Return
        Else
            Dim button As LinkButton = CType(e.Item.Cells(0).Controls(0), LinkButton)
            e.Item.Attributes("onclick") = Page.GetPostBackClientHyperlink(button, "")
        End If
    End Sub
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform