【发布时间】:2019-05-18 15:13:14
【问题描述】:
当用户在我的数据网格视图中选择一行时,数据网格视图之外的标签不会更新。
正如您在 Visual Studio 中看到的,已捕获所选行的值。但是在视觉上它不会更新。
这是我的数据网格代码的样子。
<asp:UpdatePanel ID="uplPanel" runat="server" >
<ContentTemplate>
<asp:GridView ID="gvInventario" runat="server" AutoGenerateColumns="false" AllowSorting="true" ShowFooter="false" DataKeyNames="componente_id, ubicacion_id, proveedor_id" PageSize="20"
ShowHeaderWhenEmpty="true" AllowPaging="True" OnPageIndexChanging="gridView_PageIndexChanging" OnSelectedIndexChanged="OnSelectedIndexChanged" OnRowDataBound="OnRowDataBound"
CellPadding="3" AllowColumResize="True" onsorting="grdDetails_Sorting" GridLines="None" CssClass="mGrid" PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt">
<Columns>
下面是网格外标签的代码
<div id="ChangeQuantitySection" class="menusection">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="Label7" runat="server" Text="Cambiar la cantidad" CssClass="second-menu-title"></asp:Label>
<br/>
<b><asp:Label ID="Label3" runat="server" Text="Proveedor: "></asp:Label></b>
<asp:Label ID="lblProveedor" runat="server" Text=""></asp:Label>
<br/>
<b><asp:Label ID="Label2" runat="server" Text="Tipo: "></asp:Label></b>
<asp:Label ID="lblType" runat="server" Text=""></asp:Label>
<br/>
<b><asp:Label ID="lblQtRequired" runat="server" Text="Cantidad requerida: "></asp:Label></b>
<asp:TextBox width="50px" ID="txtQtRequired" runat="server" TextMode="Number" min="0" step="1" Value="0"></asp:TextBox>
<br/>
<asp:Button class="btn btn-primary" ID="Button1" runat="server" Text="Validar" OnClick="Confirm_purchase_order_Click" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
【问题讨论】:
标签: c# asp.net datagridview updatepanel