How to refer to linkbutton in datagrid using ItemIndex?

S

susie

I have another issue coming up after I am able to sort the
records in asc and desc.
The sorting function is created in master sheet.
The first column were created as linkbuttons and will not
be sorted.
The following code is for the first column linked button.
Sub Master_ItemCommand( s As Object, e As
DataGridCommandEventArgs )
intJobNum=Master.DataKeys(e.Item.ItemIndex)
Master.SelectedIndex = e.Item.ItemIndex
BindDetailGrid
End Sub

However I found that the above function(or sub routine)
interfers with sort functions.
I am no long able to use the sorting function unless I
comment out the above sub routine.
It seems like that ItemIndex referred to all the linked
items in the master sheet since sorting function turn the
headings into linked items.
How can refer to the Item in the first column(linked
button column) only in my Master_ItemCommand ?

I can not use Cells(0).Controls(1) directedly because cell
is not an item in DataGrid.
Do you have any suggestions?
 

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

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top