Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Datagrid - Select a Row
Message
De
23/11/2004 08:46:31
 
 
À
23/11/2004 08:41:44
Alvin Lourdes
Children and Youth Services Cluster
Toronto, Ontario, Canada
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00963801
Message ID:
00963804
Vues:
7
Hi Alvin!

This is how I'm doing this.

First you check the Commandname and inside the object E.ITEM you'll have all the columns of your datagrid (beginning with 0).

HTH
Private Sub grdKonten_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles grdKonten.ItemCommand
        Select Case e.CommandName.ToUpper
            Case "SELECT"
                With e.Item
                    Session("nGrdEdit") = .Cells(1).Text
                    Me.txtKtonr.Text = RTrim(.Cells(2).Text)
                    Me.txtKtobez.Text = RTrim(.Cells(3).Text)
                    Me.cboArt.SelectedIndex = -1
                    Me.cboArt.Items.FindByValue(.Cells(4).Text).Selected = True
                    Me.cboUcd.SelectedIndex = -1
                    Me.cboUcd.Items.FindByValue(.Cells(5).Text).Selected = True
                End With
          Case "DELETE"
              Server.Transfer("frm_delete.aspx?name=ktonr&id=" + e.Item.Cells(1).Text + "&redir=frm_kto.aspx")
     End Select
End Sub
>Hello,
>
>I want the ability to select a row in the datagrid and return some values from the rows.
>The problem is that when I use the SELECT button, I cannot get to the values that the user selected and when I use the EDIT, UPDATE, CANCEL buttons.. I can get to the data but the other buttons show up.
>
>Any help would be appreciated.
>
>Thanks
robert.oh.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform