Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Problem to update in my gridview

Reply
Thread Tools

Problem to update in my gridview

 
 
egsdar
Guest
Posts: n/a
 
      11-08-2008
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>
<asparameter Name="Descripcion" />
<asparameter Name="IdGrupo" />
<asparameter Name="IdTipoPropuesta" />
</UpdateParameters>
<DeleteParameters>
<asparameter 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>
<aspropDownList ID="DropDownList2" runat="server"
DataSourceID="SqlDataSource4"
DataTextField="Descripcion"
DataValueField="IdGrupo"
Style="position: static" SelectedValue='<%#
Bind("IdGrupo") %>'>
</aspropDownList>
</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>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Update On The Windows Phone 7 Update Update Lawrence D'Oliveiro NZ Computing 2 02-25-2011 08:03 AM
Gridview inside gridview problem Vik ASP .Net 1 05-11-2009 10:07 PM
GridView Update doesn't update on first postback Evan M. ASP .Net 1 04-18-2007 03:32 PM
1 global update button to update all rows in Gridview mesut ASP .Net 0 02-19-2007 02:00 PM
GridView Hierarchical View - Gridview in Gridview =?Utf-8?B?bWdvbnphbGVzMw==?= ASP .Net 1 05-09-2006 06:48 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57