asp.net gridview中TextBox 有内容,选中当前行checkbox
平台:visual studio 2008
要求:gridview中当前行<asp:TextBox></asp:TextBox>有值时,对应的<asp:CheckBox></asp:CheckBox>自动勾选(离开文本框时判断也行)
部分代码:
<body>
<form id = "form1" runat="server">
<div>
<asp:GridView ID="GV" runat="server" AllowPaging="True" AutoGenerateColumns="False" DataKeyNames="id,dm" Width="100%"
DataSourceID="SDSgv" GridLines="Vertical">
<Columns>
<asp:TemplateField HeaderText="发货数量">
<ItemTemplate>
<asp:Panel ID="Psl" runat="server" CssClass ="style12">
<asp:TextBox ID="TBsl" runat="server" Width="50"></asp:TextBox>
</asp:Panel>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="勾选">
<ItemTemplate>
<asp:CheckBox ID="CB" runat="server" Checked="false" CssClass ="style12"/>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</asp:Panel>
</div>
</form>
</body>
请问客户端用javascript能实现吗,
服务器端呢?
或者说 两边都要用到?!
------解决方案--------------------
refer:
http://www.cnblogs.com/insus/archive/2012/09/22/2698003.html