Handle the ItemCommand event and set the SelectedIndex.
Includea button in your <ItemTemplate> section:
<ASP:Button CommandName="Select" Text="Info" runat="server" />
Add OnItemCommand="DoItemSelect" to your DataGrid and use an event handler
like this:
Sub DoItemSelect(objSource As Object, objArgs As DataGridCommandEventArgs)
'see if it was the Select button that was clicked
If objArgs.CommandName = "Select" Then
'set the SelectedIndex property of the list to this item's index
MyDataGrid.SelectedIndex = objArgs.Item.ItemIndex
BindDataGrid() 'bind the data and display it
End If
End Sub
"Zachary Hilbun" <gu****@vianova.com> wrote in message
news:sI****************@newssvr12.news.prodigy.com ...
I'm using a DataGrid control in a web form. I can display it using
binding but when I click on any of the items there is no feedback that that row
has been selected. I changed SelectedItemStyle but the changes do not appear
when a row is clicked. What do I need to do to get it to do selection?
================================================== =
Zachary Hilbun
Software Consultant http://www.vianova.com
Via Nova OpenGL, Open Inventor 3D products, Windows 95/NT
Dallas, Texas VC++, C#, embedded systems, VxD's
1977 SSII SRX31185
Glock 30