still trying to figure out datalist event handler

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hey all,
i was just wondering when does the DataList_SelectedIndexChanged ever occur.
I've only used it as a container for other controls such as a link button.

thanks,
rodchar
 
I would hazard a guess that the SelectedIndexChanged event occurs when
the selected index changes.

If the datalist works like other controls, this will occur (without any
extra work from you) when a child control raises the Command event with
a command name of "select".

So <asp:LinkButton id=".." runat="server" CommandName="Select"
Text="Might select a given DataListItem" />

Note: I haven't tested that, but the GridView handles ItemCommand
events with command names of "select", "insert", "update", and "delete"
automatically and fires the appropriate GridView events.
 
Back
Top