Hello, I'm adding in a gridview a dropdownlist that has its own SqlDataSource, the idea of this not to display this:
TABLE: TipoPropuesta
ID Descripcion IdGrupo
1 Datacenter Services 3
But to display this:
ID Descripcion IdGrupo
1 Datacenter Services Callcenter
The table TipoPropuesta is related with the table Group and from this i'm feeding my dropdownlist in order to select the group, the thing is that I have already this, but when I try to update the record is not doing updating it.
This is my code:
How can i solve this?
TABLE: TipoPropuesta
ID Descripcion IdGrupo
1 Datacenter Services 3
But to display this:
ID Descripcion IdGrupo
1 Datacenter Services Callcenter
The table TipoPropuesta is related with the table Group and from this i'm feeding my dropdownlist in order to select the group, the thing is that I have already this, but when I try to update the record is not doing updating it.
This is my code:
Code:
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="SIP :: Consulta de Sector" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
<a href="Sector.aspx"><span style="font-size: 24pt">Sector</span></a><span style="font-size: 24pt">
:: Consultas<br />
<br />
<br />
<asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:SIPConnectionString %>"
SelectCommand="SELECT * FROM [Grupo]"></asp:SqlDataSource>
<br />
<asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:SIPConnectionString %>"
SelectCommand="SELECT TipoPropuesta.IdTipoPropuesta AS Expr2, TipoPropuesta.Descripcion AS Expr3, TipoPropuesta.IdGrupo, Grupo.Descripcion AS Expr1 FROM TipoPropuesta INNER JOIN Grupo ON TipoPropuesta.IdGrupo = Grupo.IdGrupo"
UpdateCommand="UPDATE [TipoPropuesta] SET [Descripcion] = @Descripcion, [IdGrupo] = @IdGrupo WHERE [IdTipoPropuesta] = @IdTipoPropuesta">
<UpdateParameters>
<asp:Parameter Name="Descripcion" />
<asp:Parameter Name="IdGrupo" />
<asp:Parameter Name="IdTipoPropuesta" />
</UpdateParameters>
</asp:SqlDataSource>
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataKeyNames="Expr2"
DataSourceID="SqlDataSource3" Style="position: static">
<Columns>
<asp:CommandField ShowEditButton="True" />
<asp:BoundField DataField="Expr2" HeaderText="Expr2" InsertVisible="False" ReadOnly="True"
SortExpression="Expr2" />
<asp:BoundField DataField="Expr3" HeaderText="Expr3" SortExpression="Expr3" />
<asp:TemplateField HeaderText="Expr1" SortExpression="Expr1">
<EditItemTemplate>
<asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="SqlDataSource4"
DataTextField="Descripcion" DataValueField="IdGrupo"
Style="position: static" SelectedValue='<%# Bind("IdGrupo") %>'>
</asp:DropDownList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("Expr1") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="IdGrupo" HeaderText="IdGrupo" SortExpression="IdGrupo" />
</Columns>
</asp:GridView>
</span>
</asp:Content>
How can i solve this?