5thcav
asked on
EZ1 get datasource name of e.Item.Cells(i) in datagrid
having trouble setting a row to session by data source name of the cell.
just need to replace "DATASOURCE" in the section below to reflect 'i' as data sourcename
Thanks
Private Sub grdks_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls. DataGridCo mmandEvent Args) Handles grdks.ItemCommand
If e.Item.ItemType = ListItemType.Pager Or e.Item.ItemType = ListItemType.Header Then
Exit Sub
End If
Dim i As Integer
For i = 0 To grdks.Items.Count - 1
Session(DATASOURCENAME) = e.Item.Cells(i).Text
Next i
end sub
just need to replace "DATASOURCE" in the section below to reflect 'i' as data sourcename
Thanks
Private Sub grdks_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.
If e.Item.ItemType = ListItemType.Pager Or e.Item.ItemType = ListItemType.Header Then
Exit Sub
End If
Dim i As Integer
For i = 0 To grdks.Items.Count - 1
Session(DATASOURCENAME) = e.Item.Cells(i).Text
Next i
end sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I thought about an array, i thought sessions would be just as good seeing im not going to have to loop through the data after i fill it,, so it seemed and array was an overkill,,, im guessing the sesion data would be less work on the server,..
ney my trouble was, i can t replace the DATASOURCENAME on this statement > Session(DATASOURCENAME) with the actual name of the datasource.
so my loop will make:
Session(Item.Cells(i).????
Session("ID") = e.Item.Cells(i).Text
Session("Fname") = e.Item.Cells(i).Text
Session("Lname") = e.Item.Cells(i).Text
thanks