Ali_64 0 Newbie Poster

Hi I am using Product Table. I choise Category DropDownList after page is postback and I choise checkbox and I choise another DropdownList after page is postback and I lost value Checkbox Checked. How can I do example.

<asp:DropDownList ID="drpKategori" Style="width: 25%" CssClass="form-control" runat="server" OnSelectedIndexChanged="drpKategori_SelectedIndexChanged" AutoPostBack="true"></asp:DropDownList>

                                                </div>

                                    <div class="form-group">
                                        <asp:Button ID="addRow" runat="server" Text="Yeni Satır" />
                                        <asp:GridView ID="example" CssClass="table table-striped table-bordered table-hover" AutoGenerateColumns="false" runat="server" ClientIDMode="Static" OnPreRender="example_PreRender" OnRowEditing="example_RowEditing" OnRowCancelingEdit="example_RowCancelingEdit" OnRowDeleting="example_RowDeleting" OnRowDataBound="example_RowDataBound">

                                            <Columns>

                                                <asp:TemplateField HeaderText="Ürün Seç" ItemStyle-Width="50">
                                                    <HeaderTemplate>
                                                        <asp:CheckBox ID="chkAll" runat="server" onclick="checkAll(this);" />
                                                    </HeaderTemplate>
                                                    <ItemTemplate>
                                                        <asp:CheckBox ID="chcsec" CssClass="form-control" runat="server" onclick="Check_Click(this);" />
                                                    </ItemTemplate>
                                                </asp:TemplateField>

                                                <asp:TemplateField HeaderText="Ürün Ad" ItemStyle-Width="100">
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblUrun" runat="server" Text='<%# Eval("UrunAd") %>'></asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="txturunad" runat="server" Text='<%# Eval("UrunAd") %>'></asp:TextBox>
                                                    </EditItemTemplate>
                                                </asp:TemplateField>

                                                <asp:TemplateField HeaderText="Stok" ItemStyle-Width="50">
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblStok" Style="padding: 3px 5px;" runat="server" Text='<%# Eval("Stok") %>'></asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="txtstok" Style="padding: 3px 5px;" runat="server" Text='<%# Eval("Stok") %>'></asp:TextBox>
                                                    </EditItemTemplate>
                                                </asp:TemplateField>

                                                <asp:TemplateField HeaderText="Fiyat" ItemStyle-Width="50">
                                                    <ItemTemplate>
                                                        <asp:Label ID="txtfiyat" Style="padding: 3px 5px;" CssClass="form-control" runat="server"></asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="txtfiyat" Style="padding: 3px 5px;" runat="server" CssClass="form-control"></asp:TextBox>
                                                    </EditItemTemplate>
                                                </asp:TemplateField>

                                                <asp:TemplateField HeaderText="Adet" ItemStyle-Width="50">
                                                    <ItemTemplate>
                                                        <asp:Label ID="txtAdet" Style="padding: 3px 5px;" CssClass="form-control" runat="server"></asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="txtAdet" runat="server" Style="padding: 3px 5px;" CssClass="form-control"></asp:TextBox>
                                                    </EditItemTemplate>
                                                </asp:TemplateField>

                                                <asp:TemplateField HeaderText="Eleman Seç" ItemStyle-Width="100">

                                                    <ItemTemplate>
                                                        <asp:DropDownList ID="drpEleman" CssClass="form-control" runat="server"></asp:DropDownList>
                                                    </ItemTemplate>

                                                </asp:TemplateField>

                                                <asp:TemplateField HeaderText="Eleman Adet" ItemStyle-Width="50">
                                                    <ItemTemplate>
                                                        <asp:Label ID="txtElemanAdet" Style="padding: 3px 5px;" CssClass="form-control" runat="server"></asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="txtElemanAdet" runat="server" Style="padding: 3px 5px;" CssClass="form-control"></asp:TextBox>
                                                    </EditItemTemplate>
                                                </asp:TemplateField>

                                                <asp:TemplateField HeaderText="Eleman Fiyat" ItemStyle-Width="50">
                                                    <ItemTemplate>
                                                        <asp:Label ID="txtElemanFiyat" Style="padding: 3px 5px;" CssClass="form-control" runat="server"></asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="txtElemanFiyat" runat="server" Style="padding: 3px 5px;" CssClass="form-control"></asp:TextBox>
                                                    </EditItemTemplate>
                                                </asp:TemplateField>

                                                <asp:CommandField ButtonType="Link" ShowEditButton="true" ShowDeleteButton="true" ItemStyle-Width="150" />
                                            </Columns>

                                        </asp:GridView>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.