Doubt Update Panel Gridview

Asked

Viewed 106 times

0

I have a Gridview inside an Update Panel, but when I click on the Grid Gridview3_selectedindexchanged event, the event does not happen, I tried to put as direct Rigger in the selectedindexchanged event, but it does not work either, follow the code of my Updatepanel with Gridview:

 <asp:UpdatePanel ID="UpdatePanel5" runat="server" ClientIDMode="Predictable">
                                    <ContentTemplate>
                                        <div class="financeiro">
                                            <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" TabIndex="10" CellPadding="4" ForeColor="#333333" GridLines="None" AllowPaging="True" OnPageIndexChanging="GridView3_PageIndexChanging" OnSelectedIndexChanged="GridView3_SelectedIndexChanged" OnRowEditing="GridView3_RowEditing" OnRowCreated="GridView3_RowCreated">
                                                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                                                <Columns>
                                                    <asp:BoundField DataField="id" HeaderText="id" ReadOnly="True" SortExpression="id" />
                                                    <asp:BoundField DataField="vencimento" HeaderText="Vencimento" SortExpression="vencimento" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"></asp:BoundField>
                                                    <asp:BoundField DataField="observacao" HeaderText="Observação" SortExpression="observacao" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"></asp:BoundField>
                                                    <asp:BoundField DataField="valor_pago" HeaderText="Valor" SortExpression="valor_pago" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"></asp:BoundField>
                                                    <asp:BoundField DataField="valor" HeaderText=" Valor Pago" SortExpression="valor" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"></asp:BoundField>
                                                    <asp:CheckBoxField DataField="quitado" HeaderText="Quitado" SortExpression="quitado" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"></asp:CheckBoxField>
                                                    <asp:CommandField ShowSelectButton="True" SelectText="<img src='images/icon/Misc-Edit-icon.png' title='Editar'/>" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                                    <asp:CommandField ShowDeleteButton="True" DeleteText="<img src='images/icon/Trash-can-icon.png' title='Excluir' />" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"></asp:CommandField>
                                                </Columns>

                                                <EditRowStyle BackColor="#999999" />
                                                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                                <SortedAscendingCellStyle BackColor="#E9E7E2" />
                                                <SortedAscendingHeaderStyle BackColor="#506C8C" />
                                                <SortedDescendingCellStyle BackColor="#FFFDF8" />
                                                <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                                            </asp:GridView>
                                        </div>
                                    </ContentTemplate>
                                    <Triggers>
                                        <asp:AsyncPostBackTrigger ControlID="GridView3" />
                                    </Triggers>
                                </asp:UpdatePanel>

And here the code inside the Gridview3_selectedindexchanged:

modalRecebimento.Visible = true;

2 answers

1

There is no need to associate the name of the event in the updatePanel Trigger? ex:

<Triggers>
      <asp:AsyncPostBackTrigger ControlID="GridView1" EventName="SelectedIndexChanged" />
</Triggers>
  • I did, but it doesn’t work either, it doesn’t leave the element visible.

0


I was able to solve by creating a function that when updated, goes back to the selected tab, follows how it was done:

  <script type="text/javascript">
        function pageLoad() {
            $(document).ready(function () {
                $("#tabs").tabs({
                    collapsible: true,
                    autoHeight: true,
                    navigation: true,
                    fillSpace: true,
                    activate: function () {
                        var newIdx = $('#tabs').tabs('option', 'active');
                        $('#<%=hdnfldVariable.ClientID%>').val(newIdx);

                    },
                    active: $('#<%=hdnfldVariable.ClientID%>').val()
                });
            });
        }
    </script>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.