日期:2014-05-17  浏览次数:20481 次

gridview+checkbox 总是得不到选中的行
我用gridview加checkbox,想修改一下选中的某行,总是得不到checkbox.checked的这一行。
前台代码:
<asp:GridView ID="GridView1" runat="server" Width="100%" 
            AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333" 
            GridLines="None">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:TemplateField>
                <ItemTemplate>
                <asp:CheckBox  ID="CheckBox" runat="server"/>
                </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="buildname" HeaderText="楼栋名称" >
                <ItemStyle HorizontalAlign="Center" />
                </asp:BoundField>
                <asp:BoundField DataField="buildid" HeaderText="楼栋编号" >
                <ItemStyle HorizontalAlign="Center" />
                </asp:BoundField>
                <asp:BoundField DataField="sumfloors" HeaderText="总楼层数" >
                <ItemStyle HorizontalAlign="Center" />
                </asp:BoundField>
                <asp:BoundField DataField="sumsets" HeaderText="总户数" >
                <ItemStyle HorizontalAlign="Center" />
                </asp:BoundField>
                <asp:BoundField DataField="use" HeaderText="楼栋用处">
                <ItemStyle HorizontalAlign="Center" />
                </asp:BoundField>
                <asp:BoundField DataField="buildarea" HeaderText="建筑面积" >
                <ItemStyle HorizontalAlign="Cent