Hi,
you don't need the row ID. Instead handle DropDownList's
SelectedIndexCh anged event and in that get reference to the DropDownList
raising the event, you'd get that via sender argument (first argument to the
event handling method)
[VB.NET]
Dim ddl As DropDownList = CType(sender, DropDownList)
[C#]
DropDownList ddl = (DropDownList)s ender;
Then trick is to know how databound controls work. The GridViewRow is naming
container of your DropDownList
[VB.NET]
Dim row As GridViewRow = CType(ddl.Namin gContainer, GridViewRow)
[C#]
GridViewRow row = (GridViewRow)dd l.NamingContain er;
I've explained some background for this type of scenarios:
Understanding the naming container hierarchy of ASP.NET databound controls
http://aspadvice.com/blogs/joteke/ar...-controls.aspx
--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke http://teemukeiski.net
"McGeeky" <an**@hotmail.c omwrote in message
news:%2******** **********@TK2M SFTNGP02.phx.gb l...
Hi. I have a read only GridView. For each row I want to display a drop
down list which contains a list of actions the user can select from for
that particular row. E.g. "view details". When they select an action in
the drop down list I want to do a post back. How will I know which row
they made the selection in?
Is there a way to embed the row Id in the drop down list so it gets sent
back to the server?
Thanks