如何从gridview中的checkBox获取状态 [英] How to get state from checkBox in gridview

查看:69
本文介绍了如何从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>

推荐答案

在没有任何其他答案的情况下,请查看此问题答案中的工作示例一些指示......



http://stackoverflow.com/questions/3084419/checkboxfield-columns-in-asp-net-gridview-are-disabled-even-if- readonly-set-to-f [ ^ ]



如果没有请帮忙说明你是如何填充数据的。
In the absence of any other answers, check out the worked example in the answer to this question for a few pointers...

http://stackoverflow.com/questions/3084419/checkboxfield-columns-in-asp-net-gridview-are-disabled-even-if-readonly-set-to-f[^]

If that doesn''t help please show how you''re populating the data.


这篇关于如何从gridview中的checkBox获取状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆