Link to home
Start Free TrialLog in
Avatar of Ed
EdFlag for United Kingdom of Great Britain and Northern Ireland

asked on

find 2 datakeys in cowcommand

I have this code that finds the a datakey in a gridview

The problem is that I have 2 datakeys in the gridview and I can't get the 2nd one..

The below code just accesses the first datakey but how do I access the 2nd?


 
Protected Sub GridView2_RowCommand(sender As Object, e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView2.RowCommand
        Dim currentCommand As String = e.CommandName
        Dim currentRowIndex As Integer = Int32.Parse(e.CommandArgument.ToString())
        Dim EmailAdd As String = GridView2.DataKeys(currentRowIndex).Value

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Rajar Ahmed
Rajar Ahmed
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ed

ASKER

Worked Perfectly, thanks