我正在使用Ajax ToggleButtonExtender显示检查并取消选中2列复选框的图像。 它们位于Panel中的GridView中。它们显示并正常工作,直到行数 GridView超出了Panel的大小,此时Panel滚动,但ToggleButtonExtender 图像继续显示在面板下方,当我滚动面板时,图像会保留在它们的位置 是这样的,不要与GridView中的其他列一起使用。 有什么想法吗?
继承我的代码:
<asp:Panel id="PanelMM" cssclass="G4panl2m" runat="Server" ScrollBars="Auto">
<asp:GridView id="GridViewMM" cssclass="gridTMAnc1" runat="server"
AutoGenerateColumns="False" DataKeyNames="AnimalID" GridLines="Vertical" ShowHeader="False" >
<RowStyle Height="10px" />
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="chkStatusMM" runat="server"
OnCheckedChanged="chkStatusMM_OnCheckedChanged" AutoPostBack="True" Width="11" Height="11" />
<asp:ToggleButtonExtender ID="tbeMM" runat="server"
TargetControlID="chkStatusMM" ImageWidth="14" ImageHeight="14"
CheckedImageAlternateText="Check" UncheckedImageAlternateText="Click to keep animal"
UncheckedImageUrl="~/images/greentick.jpg" CheckedImageUrl="~/images/blankcheckbox.jpg" >
</asp:ToggleButtonExtender>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="chkStatusMM2" runat="server"
OnCheckedChanged="chkStatusMM2_OnCheckedChanged" AutoPostBack="True" Height="11" Width="11" />
<asp:ToggleButtonExtender ID="tbeMM2" runat="server"
TargetControlID="chkStatusMM2" ImageWidth="11" ImageHeight="11"
CheckedImageAlternateText="Check" UncheckedImageAlternateText="Click to remove animal"
UncheckedImageUrl="~/images/redcross.jpg" CheckedImageUrl="~/images/blankcheckbox.jpg" >
</asp:ToggleButtonExtender>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Name" HeaderText="Name" >
<ItemStyle Wrap="False" />
</asp:BoundField>
<asp:BoundField DataField="AnimalID" HeaderText="ID" Visible="False" />
</Columns>
</asp:GridView>
</asp:Panel>