Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SelectedIndexChanged EventArgs Question 1

Status
Not open for further replies.

PoppapumpJ

Programmer
Dec 17, 2001
86
0
0
US
Hey, I have a datagrid with a ButtonColumn added in it. when i Click the button the event handler fires, but how do I get information about the Selected Item. The only properties available to e are Empty and GetType.

here is a clip of the code

[tt]
'Page load event
With ButColAdd
.ButtonType = ButtonColumnType.LinkButton
.text = "Add To Cart"
.CommandName = "Select"
end with

With dgIssues
.columns.add(butColAdd)
'Other columns added here
.datasource = dsIssues
.Databind
End with


'selectedIndexChanged Event
Private Sub dgIssues_SelectedIndexChanged(ByVal sender as Object, ByVal e as system.EventArgs) Handles dgIssues.SelectedIndexChanged

'This is where I would like to get information about the selected item, such as name and value

end sub
[/tt]
 
Pop,

You do not use e property you use the datagrid's selected Item property ie: dgIssues.selecteditem.cell(n).text
where n is the number of the cell.


CtDapper
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top