本文介绍了如何从gridview中的checkBox获取状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
希望有人能帮助我在gridview中获取复选框的状态,这里是gridview代码:
Hi,
Hope some one can help me to get the state of the checkbox in the gridview here is the gridview code:
<asp:GridView ID="grid" runat="server" Style="margin-left: 0px" AutoGenerateColumns="False"
CellPadding="4" ForeColor="#333333" GridLines="None" Font-Size="Smaller" Width="700px"
DataKeyNames="OrderCode" OnRowEditing="grid_RowEditing" OnRowDeleting="grid_RowDeleting"
CssClass="tabela" HorizontalAlign="Center" AlternatingRowStyle-HorizontalAlign="Center"
RowStyle-HorizontalAlign="Center" AllowPaging="True" OnPageIndexChanging="grid_PageIndexChanging">
<AlternatingRowStyle BackColor="White" ForeColor="#284775" HorizontalAlign="Center" />
<Columns>
<asp:BoundField DataField="OrderCode" HeaderText="Код на нарачка" />
<asp:BoundField DataField="DateCreated" HeaderText="Дата на креирана нарачка" />
<asp:CheckBoxField DataField="Payed" HeaderText="Платено" />
<asp:CheckBoxField DataField="ReadyForShipping" HeaderText="Спремно за испорака" />
<asp:CheckBoxField DataField="Shipped" HeaderText="Испратено" />
<asp:CheckBoxField DataField="Delivered" HeaderText="Доставено" />
<asp:CheckBoxField DataField="Cashed" HeaderText="Исплатено" />
<asp:BoundField DataField="ProductName" HeaderText="Име на производ" />
<asp:BoundField DataField="UnitCost" HeaderText="Цена" />
<asp:BoundField DataField="Size" HeaderText="Големина" />
<asp:BoundField DataField="Quantity" HeaderText="Количина" />
<asp:TemplateField HeaderText="Спремно за испорака" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:ImageButton ID="Agree" runat="server" ImageUrl="../Dodatoci za Master/agreee.png"
CommandName="Edit" OnClientClick="return confirm('Дали производот е спремен за испорака (соодветно спакуван)?');"
AlternateText="Give Permission" />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Откажи нарачка" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:ImageButton ID="Cancel" runat="server" ImageUrl="../Dodatoci za Master/delete.png"
CommandName="Delete" OnClientClick="return confirm('Дали сте сигурни дека сакате да ја откажете нарачката?');"
AlternateText="Give Permission" />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
</Columns>
</asp:GridView>
推荐答案
这篇关于如何从gridview中的checkBox获取状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!