| | |
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: 80
Reputation:
Solved Threads: 14
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 ajax alltypeofvideos appliances application asp asp.net bc30451 beginner bottomasp.net box browser button c# cac checkbox commonfunctions control dataaccesslayer database datagridview datagridviewcheckbox datalist deployment development dgv dialog dropdownlist dynamic dynamically edit embeddingactivexcontrol expose feedback fileuploader fill findcontrol flash form formatdecimal formview gridview gudi iis image javascript listbox login microsoft mobile mono mouse mssql news novell numerical opera panelmasterpagebuttoncontrols parent radio redirect registration relationaldatabases reportemail save schoolproject search security select sessionvariables silverlight smartcard smoobjects software sql-server sqlserver2005 ssl suse textbox tracking treeview unauthorized validatedate validation vb.net video videos view vista visualstudio web webapplications webdevelopemnt webdevelopment webprogramming webservice xsl youareanotmemberofthedebuggerusers





