Nov 22, 2018, 2:51 PM
[CLOSED] UpdatePanel not refresh
Hello Fabricio:
I have the next piece of code in coolite:
When click the column <detalle> the script <gvDepo_SelectedIndexChanged> is trigered. And the second gridview turn visible and the gridview is populated. Like the next screen show.
I rewrite the next code for Ext.Net 4:
The code-behind is the same.
I have the problem that when i click the column <detalle> the page is not updated and show a Blank page when in coolite refresh the panel and show the second grid and populate it.
It's exactly the same code so i think something in Ext.Net 4 is different and for this reason doesn´t update correctly. Some idea?
Thanks for the patience.
Regards
I have the next piece of code in coolite:
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<ext:TabPanel ID="tabDepositos" runat="server" Height="830px" ActiveTabIndex="0"
DeferredRender="false">
<Tabs>
<ext:Tab ID="tab1" runat="server" Icon="Basket" Title="Depositos">
<Body>
<ext:BorderLayout ID="BorderLayout1" runat="server">
<Center>
<ext:Panel runat="server" ID="pnlCaja2" Title="Depositos encontrados" Icon="Basket">
<Body>
<table class="Modulo_Tony" width="99%">
<tr>
<td colspan="3">
<asp:GridView ID="gvDepo" runat="server" CssClass="grid" AllowPaging="True" DataSourceID="SqlDepo">
<SelectedRowStyle CssClass="selectedrow"></SelectedRowStyle>
<AlternatingRowStyle CssClass="altrowstyle"></AlternatingRowStyle>
<Columns>
<asp:CommandField SelectText="Detalle" ShowSelectButton="True"></asp:CommandField>
</Columns>
<EmptyDataTemplate>
<span style="font-size: 9pt; color: #cc3300; font-family: Verdana">No existen depositos
creados.</span>
</EmptyDataTemplate>
<PagerStyle CssClass="pagerstyle"></PagerStyle>
</asp:GridView>
</td>
</tr>
</table>
<asp:SqlDataSource ID="SqlDepo" runat="server"></asp:SqlDataSource>
<ext:Panel ID="pnlPolizas" runat="server" Title="Pólizas relacionadas" Visible="false">
<Body>
<table class="Modulo_Tony" width="99%">
<tr>
<td colspan="3">
<asp:GridView ID="gvDepoPol" runat="server" CssClass="grid" AllowPaging="True" DataSourceID="SqlDepoPol"
OnSelectedIndexChanged="gvDepoPol_SelectedIndexChanged">
<Columns>
<asp:CommandField SelectText="Asignar" ShowSelectButton="True"></asp:CommandField>
</Columns>
<EmptyDataTemplate>
<span style="font-size: 9pt; color: #cc3300; font-family: Verdana">No se encuentra polizas
relacionadas.</span>
</EmptyDataTemplate>
<SelectedRowStyle CssClass="selectedrow"></SelectedRowStyle>
<PagerStyle CssClass="pagerstyle"></PagerStyle>
<AlternatingRowStyle CssClass="altrowstyle"></AlternatingRowStyle>
</asp:GridView>
</td>
</tr>
.....
The code-behind is: Protected Sub gvDepo_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles gvDepo.SelectedIndexChanged
cargaDepoPol()
End Sub
Public Sub cargaDepoPol()
Dim sql As String
sql = "SELECT adpoliza.cramo AS CRamo, rtrim(maramos.xdescripcion_l) AS Ramo, adpoliza.cnpoliza AS Póliza, adpoliza.cpoliza AS CPol, adpoliza.fanopol AS AnoPol, adpoliza.fmespol AS MesPol, CONVERT(CHAR(10),adpoliza.fdesde,101) AS FInicial, CONVERT(CHAR(10),adpoliza.fhasta,101) AS FFinal,"
sql += " adpoliza.ctenedor AS CTenedor, rtrim(maeTene.xcliente) AS Tenedor, adpoliza.casegurado AS CAseg, rtrim(maeAseg.xcliente) AS Asegurado"
sql += " FROM (((adpoliza INNER JOIN maentes maeTene ON adpoliza.ctenedor = maeTene.cci_rif)"
sql += " INNER JOIN maentes maeAseg ON adpoliza.casegurado = maeAseg.cci_rif)"
sql += " INNER JOIN maramos ON adpoliza.cramo = maramos.cramo)"
sql += " WHERE adpoliza.ctenedor = " & gvDepo.Rows(gvDepo.SelectedIndex).Cells(3).Text
SqlDepoPol.ConnectionString = Vg.ConnectionStringMundisis
SqlDepoPol.SelectCommand = sql
SqlDepoPol.DataBind()
gvDepoPol.AllowPaging = False
gvDepoPol.DataBind()
gvDepoPol.Caption = "Registros (" & gvDepoPol.Rows.Count & ")"
gvDepoPol.AllowPaging = True
pnlPolizas.Visible = True
End Sub
The idea is that i have a master-detail structure with the GridView gvDepo like Master and the GridView gvDepoPol like detail. Initially the second panel (pnlPolizas) is not visible like show you in this picture.When click the column <detalle> the script <gvDepo_SelectedIndexChanged> is trigered. And the second gridview turn visible and the gridview is populated. Like the next screen show.
I rewrite the next code for Ext.Net 4:
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<ext:ResourceManager runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<ext:TabPanel ID="tabDepositos" runat="server" Height="830px" ActiveTabIndex="0"
DeferredRender="false">
<Items>
<ext:Panel ID="tab1" runat="server" Icon="Basket" Title="Depositos"
layout="BorderLayout">
<Items>
<%--<ext:BorderLayout ID="BorderLayout1" runat="server">
<Center>--%>
<ext:Panel runat="server" ID="pnlCaja2" Title="Depositos encontrados" Icon="Basket"
region="Center">
<Content>
<table class="Modulo_Tony" width="99%">
<tr>
<td colspan="3">
<asp:GridView ID="gvDepo" runat="server" CssClass="grid" AllowPaging="True" DataSourceID="SqlDepo"
OnSelectedIndexChanged="gvDepo_SelectedIndexChanged">
<SelectedRowStyle CssClass="selectedrow"></SelectedRowStyle>
<AlternatingRowStyle CssClass="altrowstyle"></AlternatingRowStyle>
<Columns>
<asp:CommandField SelectText="Detalle" ShowSelectButton="True"></asp:CommandField>
</Columns>
<EmptyDataTemplate>
<span style="font-size: 9pt; color: #cc3300; font-family: Verdana">No existen depositos
creados.</span>
</EmptyDataTemplate>
<PagerStyle CssClass="pagerstyle"></PagerStyle>
</asp:GridView>
</td>
</tr>
</table>
<asp:SqlDataSource ID="SqlDepo" runat="server"></asp:SqlDataSource>
<ext:Panel ID="pnlPolizas" runat="server" Title="Pólizas relacionadas" Visible="false"
region="Center">
<Content>
<table class="Modulo_Tony" width="99%">
<tr>
<td colspan="3">
<asp:GridView ID="gvDepoPol" runat="server" CssClass="grid" AllowPaging="True" DataSourceID="SqlDepoPol"
OnSelectedIndexChanged="gvDepoPol_SelectedIndexChanged">
<Columns>
<asp:CommandField SelectText="Asignar" ShowSelectButton="True"></asp:CommandField>
</Columns>
<EmptyDataTemplate>
<span style="font-size: 9pt; color: #cc3300; font-family: Verdana">No se encuentra polizas
relacionadas.</span>
</EmptyDataTemplate>
<SelectedRowStyle CssClass="selectedrow"></SelectedRowStyle>
<PagerStyle CssClass="pagerstyle"></PagerStyle>
<AlternatingRowStyle CssClass="altrowstyle"></AlternatingRowStyle>
</asp:GridView>
</td>
</tr>
.....
Is basically the same code except changing the layout, region and tab.The code-behind is the same.
I have the problem that when i click the column <detalle> the page is not updated and show a Blank page when in coolite refresh the panel and show the second grid and populate it.
It's exactly the same code so i think something in Ext.Net 4 is different and for this reason doesn´t update correctly. Some idea?
Thanks for the patience.
Regards
Last edited by fabricio.murta; Dec 18, 2018 at 8:38 PM.