Problem to update in my gridview

E

egsdar

Hello, I'm trying to do an update in my gridview but it is not doing for
"Descripcion" it but with the other field "IdGrupo" it does and I need to
save both, how can I solve this:


This is my code:

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
<span style="font-size: 24pt">
<img src="Images/Barra_tipopropuesta.png" style="position: static"
/><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 Descripcion, 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" DeleteCommand="DELETE FROM [TipoPropuesta] Where
[IdTipoPropuesta] = @IdTipoPropuesta">
<UpdateParameters>
<asp:parameter Name="Descripcion" />
<asp:parameter Name="IdGrupo" />
<asp:parameter Name="IdTipoPropuesta" />
</UpdateParameters>
<DeleteParameters>
<asp:parameter Name="IdTipoPropuesta" />
</DeleteParameters>
</asp:SqlDataSource>
<center><span style="font-size: 14pt; font-family: Microsoft Sans
Serif">Consultas
:: Tipos de Propuesta</span><br />

<asp:GridView ID="GridView2" runat="server"
AutoGenerateColumns="False" DataKeyNames="Expr2"
DataSourceID="SqlDataSource3" Style="position: static"
BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px"
CellPadding="2" ForeColor="Black" GridLines="None" Font-Size="11px">
<Columns>
<asp:CommandField ShowEditButton="True"
ShowDeleteButton="True" />
<asp:BoundField DataField="Expr2" HeaderText="ID"
InsertVisible="False" ReadOnly="True"
SortExpression="Expr2" />
<asp:TemplateField HeaderText="T. Propuesta"
SortExpression="Expr3">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%#
Bind("Descripcion") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%#
Bind("Descripcion") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Grupo" 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" Visible="False" />
</Columns>
<FooterStyle BackColor="Tan" />
<PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue"
HorizontalAlign="Center" />
<SelectedRowStyle BackColor="DarkSlateBlue"
ForeColor="GhostWhite" />
<HeaderStyle BackColor="Tan" Font-Bold="True" />
<AlternatingRowStyle BackColor="PaleGoldenrod" />
</asp:GridView>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,931
Messages
2,570,085
Members
46,536
Latest member
keelop

Latest Threads

Top