| | |
Problem with Edit/Update in GridView...
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2008
Posts: 5
Reputation:
Solved Threads: 0
Hi,
I just add a GridView with Edit option.
I connected it to DataSource.
Now, one field is a date, so I convert it's column to a template and added in the editItem template an ajax calendar extender which connected to the Texbox and works by clicking a button which I also added in the editItem template.
my problem is,
When the caldendar appears and I select a new date,
it show in the Textbox but when I press Update
the new date I just entered isnt update at all..
what I did wrong?
aspx code of editItem template:
and aspx code of update:
How to fix it.
Thanks.
I just add a GridView with Edit option.
I connected it to DataSource.
Now, one field is a date, so I convert it's column to a template and added in the editItem template an ajax calendar extender which connected to the Texbox and works by clicking a button which I also added in the editItem template.
my problem is,
When the caldendar appears and I select a new date,
it show in the Textbox but when I press Update
the new date I just entered isnt update at all..
what I did wrong?
aspx code of editItem template:
asp.net Syntax (Toggle Plain Text)
<asp:TemplateField HeaderText="ord_date" SortExpression="ord_date"> <EditItemTemplate> <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("ord_date", "{0:d}") %>'></asp:TextBox> <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/calendar.gif" /> <cc1:CalendarExtender ID="CalendarExtender1" runat="server" PopupButtonID="ImageButton1" TargetControlID="ord_date"> </cc1:CalendarExtender> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Bind("ord_date", "{0:d}") %>'></asp:Label> <br /> </ItemTemplate> </asp:TemplateField>
and aspx code of update:
asp.net Syntax (Toggle Plain Text)
UpdateCommand="UPDATE [sales] SET [ord_date] = @ord_date, [qty] = @qty, [payterms] = @payterms WHERE [stor_id] = @original_stor_id AND [ord_num] = @original_ord_num AND [title_id] = @original_title_id AND [ord_date] = @original_ord_date AND [qty] = @original_qty AND [payterms] = @original_payterms">
How to fix it.
Thanks.
Last edited by peter_budo; Nov 29th, 2008 at 5:59 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
•
•
Join Date: Sep 2007
Posts: 68
Reputation:
Solved Threads: 13
Hi
Try to find the value of the grid's control
Let me know if it solves your problem!
Try to find the value of the grid's control
ASP.NET Syntax (Toggle Plain Text)
Dim MyTxt As TextBox MyTxt = CType(Mygridview.FindControl("ord_Date"), TextBox)
Let me know if it solves your problem!
![]() |
Similar Threads
- editing Rows of the gridview, which is bounded with DataTable (ASP.NET)
- GridView Insert Problem (ASP.NET)
- sqldatasourse and gridview (ASP.NET)
- Gridview and formview, Gridview not updating immdly. (ASP.NET)
- GridView Edit and Delete buttons (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: ASP.NET - session objects Problem
- Next Thread: Different Languages in .Net
| Thread Tools | Search this Thread |
.net 2.0 activexcontrol advice ajax alltypeofvideos application asp asp.net bc30451 bottomasp.net browser button c# c#gridviewcolumn checkbox click commonfunctions compatible confirmationcodegeneration content courier css dataaccesslayer database datagridview datagridviewcheckbox datalist deadlock development dgv dropdownlist dynamically edit expose feedback fill flash form formatdecimal forms formview gridview homeedition hosting iframe iis javascript jquery listbox login microsoft mono mouse mssql multistepregistration news numerical objects opera panelmasterpagebuttoncontrols parent radio ratings registration reportemail rotatepage save schoolproject search security serializesmo.table silverlight smartcard smoobjects software sql-server sqlserver2005 suse textbox tracking typeof unauthorized validation vb.net video videos virtualdirectory vista visual-studio visualstudio web webapplications webarchitecture webdevelopemnt webprogramming webservice xml xsl youareanotmemberofthedebuggerusers





