datagrid 模版使用问题
sunly 2005-12-15 10:47:57 我想做成这样的效果:上面一行显示用户的姓名,联系方式,投票按钮,下面一行显示用户的建议。用Datagrid绑定。
我现在的问题是只能在投票按钮的位置加一个Button,不知道怎样取得此文章的ID。
以前的绑定不用模版知道怎样做,现在这种不知道怎样了。
<asp:DataGrid id="DataGridTip" style="Z-INDEX: 101; LEFT: 88px; POSITION: absolute; TOP: 96px"
runat="server" AutoGenerateColumns="False" Width="312px" PageSize="3" AllowPaging="True">
<Columns>
<asp:BoundColumn Visible="False" DataField="ID" HeaderText="ID"></asp:BoundColumn>
<asp:TemplateColumn>
<ItemTemplate>
<FONT face=宋体>
<TABLE id=table1 cellSpacing=1 width=600 border=0>
<TR>
<TD width="25%" bgColor=#f0f0f0>姓名:</TD>
<TD width="25%" bgColor=#f0f0f0>联系方式:</TD>
<TD width="25%" bgColor=#f0f0f0>当前票数:</TD>
<TD width="25%" bgColor=#f0f0f0>在此需要一个投票按钮</TD></TR>
<TR>
<TD width="75%" bgColor=#f0f0f0 colSpan=4>内容:<%# DataBinder.Eval(Container, "DataItem.Content") %><BR></TD></TR>
<TR>
<TD width="75%" colSpan=4 height=20></TD></TR></TABLE></FONT>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
<PagerStyle Mode="NumericPages">
</PagerStyle>
</asp:DataGrid>