Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Datagrid - Select a Row
Message
From
23/11/2004 08:46:31
 
 
To
23/11/2004 08:41:44
Alvin Lourdes
Children and Youth Services Cluster
Toronto, Ontario, Canada
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00963801
Message ID:
00963804
Views:
8
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform