div inside a gridview itemtemplate
How do I create and control the content of a div inside a cell of开发者_如何学Python an itemtemplate in a gridview?
Thanks.
Give your div and id and runat="server" then use the rowdatabound event
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rowdatabound.aspx
You'll then need to find your div within each row based on the id and make whatever changes you need
Oh and don't forget to use this within your rowdatabound event or you'll grab headers, footers, etc and not be able to find your control in there
if(e.Row.RowType == DataControlRowType.DataRow)
精彩评论