Datagrid & imagebutton

A

Alessandro

I have a datagrid with a templatecolumn, in this template there are two
imagebutton, one for modify the record, one to cancel, but i'm not able to
retrive the unique which is memorized in a hidden column, any idea ?
I tried to set commandargument parameter via code, but i wasn't able to
assign it.
 
J

Jim Mitchell

Let me know if this helps....



Private Sub dgAccountPages_ItemCommand1(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs) Handles
dgAccountPages.ItemCommand

Dim dg_index As Integer

Dim contact_id As Integer

Dim temp As Integer

txtPagePick.Text = "It was clicked"

dgAccountPages.DataKeyField = "IDofContact"

dg_index = e.Item.ItemIndex

contact_id = dgAccountPages.DataKeys.Item(e.Item.ItemIndex)

txtContactID.Text = contact_id

Select Case e.CommandSource.id

Case "imgbtnContactNote"

btnAddNote.Text = "Add Note"

Case "imgbtnContactCalendar"

btnAddNote.Text = "Add Activity"

End Select
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top