G
Guest
I have a checkbox control in a GridView EditItemTemplate. My SqlDataAdapter
complains when I try and use UpdateCommand
Thanks on any binding clarification.
GridView:
<asp:TemplateField HeaderText="Active">
<ItemTemplate>
<asp:CheckBox ID="ActiveCheckBox" runat="server" Checked='<%#
Eval("Active") %>' />
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ActiveCheckBox" runat="server" Checked='<%#
Bind("Active") %>' />
</EditItemTemplate>
</asp:TemplateField>
UpdateCommand="Update dbo.Vans set VendorVanNo=@VendorVanNo, ...
Active=@Active ... where VanId=@VanId">
<UpdateParameters>
<asparameter Name="VendorVanNo"/>
...
<asp:ControlParameter Name="ActiveCheckBox"
ControlId="ActiveCheckbox" PropertyName="Checked"/>
...
</UpdateParameters>
complains when I try and use UpdateCommand
Thanks on any binding clarification.
GridView:
<asp:TemplateField HeaderText="Active">
<ItemTemplate>
<asp:CheckBox ID="ActiveCheckBox" runat="server" Checked='<%#
Eval("Active") %>' />
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ActiveCheckBox" runat="server" Checked='<%#
Bind("Active") %>' />
</EditItemTemplate>
</asp:TemplateField>
UpdateCommand="Update dbo.Vans set VendorVanNo=@VendorVanNo, ...
Active=@Active ... where VanId=@VanId">
<UpdateParameters>
<asparameter Name="VendorVanNo"/>
...
<asp:ControlParameter Name="ActiveCheckBox"
ControlId="ActiveCheckbox" PropertyName="Checked"/>
...
</UpdateParameters>