Issue with Template Columns & Bound Columns while updating the data in a GridView control

Hi,

I'm facing the below problem (In general, ObjectDataSource is driving me crazy ! )

I have a simple gridview control and an ObjectDataSource is used to populate the grid. I'm trying to update a row and the corresponding tableadapter methods & stored procedure are in place. Each row has 2 checkboxes and 2 textboxes in edit mode.

When the change the values in edit mode and hit update, the checkbox values changed are saved into the Database properly, whereas the textbox values are not being saved.

If the textbox column is a bound column then the column is updated with <NULL> in Database. If I change it to a template column, then no update is done; the old value is retained in Database. So, in none of the cases I get the desired result.

What am I missing here? I have NO code in any of the events like GridView_RowUpdating etc.. and I intend not to have any. This is pretty straightforward update.

Please help.

 Thanks

Jai

0
jaikanth_n
5/10/2007 6:53:56 AM
asp.net.object-datasource 16182 articles. 0 followers. Follow

1 Replies
741 Views

Similar Articles

[PageSpeed] 21

Hi Jai,

Since there are only 2 columns updated, I suggest you check the UPDATE statement in your Update method of ObjectDataSource. The code to update the other 2 columns might be missing.

You can try to add some breakpoints in the Update method, step through it to see if every parameter and value has been added properly.

If you're using a SQL Server database, you can also start SQL Profiler to get a trace to see what is actually being executed on the server.


Sincerely,
Kevin Yu
Microsoft Online Community Support

Please remember to click “Mark as Answer” on the post that helps you, and to click “Mark as Not Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
0
Kevin
5/14/2007 3:30:14 AM
Reply:

Similar Artilces:

Can Unbound templated controls in a Gridview Update a bound column?
I have a list of stuffed integer words representing several pieces of data. My datasource has two colums - ID and DATAWORD and I want to present the user with a couple of Dropdowns and checkboxes showing the unpacked data for that row. I have done this by populating my unbound controls in the row.databound event  and it works How do I go about Updating the DATAWORD from my unbound controls?  Any pointers to articles that address this would be much appreciated. Thanks   Bill I have a GridView that populates a CSLAObjectDataSource from unbound data.  When the...

Bound columns and template columns in Gridview
Hello Everyone, In my gridview, I changed some of the bound columns to template columns, I noticed that the template column is not recognized inside the RowDataBound event method. The reason I changed the bound columns to template columns so that I can add the total column in the footer. I guess I cannot do that with bound columns. If I do e.Row.Cells[5].Text then  5th column is not recognixed inside the Rowdatabound event, but If i do e.Row.Cells[4].Text then  it is recognized. Please let me know what am I doing wrong. <asp:GridView ID="dgAgentActivity" runat="server" AutoGen...

Gridview: Can a list control & it's SQL Datasource reside in a templated column?
Thank you for your time... Working in asp.net 2.0 Visual Basic (no ajax) GridView row is parent and currently displaying related child titles by concatenating into a delimited list and populating a label.  Works, but hard to read and the function logic isnt 100% dependable.  Would like to improve by ditching the concatenated list and using a bulleted list control.  Can't find any reference to doing this.  Can a bulleted list and it's SQL datasource reside inside a templated GridView Column?  Any 2.0 VB advice is appreciated! Wesolek:...

remove a gridview column dynamically, removes controls in template columns
I have a interface with a treeview and a gridview. The gridview has two templatefields that handles insert/update/deletes. The gridview is handling editing of different tables so I create the other columns in the gridview dynamically as boundfields. The user selects the table to edit in the treeview. The problem I am having happens when the user selects a table to edit the second time. The code that executes removes all bound fields, (dynamically added when user selected the first table in the treeview), but not the two template fields, and then adds boundfields specifi...

in a grid how to find a particular column is bound column or template column
hi,  Any one know how to find a particular column is bound column or template column or button column,etc in a grid Advance thanks   hi...use this dim label1 as Label=ctype(GridView1.FindControl("name"),Label) Hope This HelpsBhaaratRemember to click "Mark as Answer" on the post that helps UMy Blog find a particular column is bound column or template column no to find that particular column  Hi,please excuse me if iam wrong.i found that bount columns values are directly renders to a <td>  where template columns create some cont...

i have work on gridview control.in that i have 3columns.name as subject,bookname,link. in this some link column data are very large.according to that data(no spaces in that data)gridview has changed.i
hi,i have work on gridview control.in that i have 3columns.name as subject,bookname,link. in this some link column data are very large.according to that data(no spaces in that data)gridview has changed.i want display half of the data and remaining display like this.(ex:http://ww.yahoo.com...........).how can i display like this,and one more thing is always the column size will constant. Try something like this: <asp:templatefield headertext="Link"> <itemtemplate> <asp:hyperlink id="HyperLink1" runat="server" navigateurl='<...

binding a gridview to xmldatasource gives "The data source for gridview gridview1 did not have any properties or attributes from which to generate columns. Ensure that your data source has columns
Greetings!  I am new to asp.net forum so feel free to point me to the proper resources or forums.  I am using Visual Studio 2005.  I have a simple web page with a gridview control and an xmldatasource control.  I am getting the above error.  Can someone point out why I am getting the above error and what I need to do to resolve it?  Thanks in advance. /////////////////////////////// default.aspx  <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="default.aspx.vb" Inherits="XMLwalkthroughVB._default" %&...

How to display a column data partially but need complete column data for update?
I have a column in my gridview that contains API KEYS for google maps. These keys are huge so i just need to display partial key for viewing purpose. But I need the complete key when user clicks on update button in gridview. How can I achieve this? Any ideas. I am copying part of my gridview aspx code. Rest of the code is coming from my class file for object datasource. <asp:GridView ID="gvDomains" runat="server" DataSourceID="odsDomains" AutoGenerateColumns="False" DataKeyNames="DomainID" Height="147px" Width="30...

Update GridView Column Content on click of Button which is included as a column in gridview
 I have Gridview wich has 4 columns1.Name of the Person2.Card Amount3.Template Field of TextBox4. Amount After Transfer I want user to enter the amount in the textbox which gets updated as the total amount (Card Amount + Amount Entered in TextBox) in the 4th column of "Amount After Transfer".I hv tried update Panel and Dynamic Populate bt nothing is working coz the textBox doesnt provide any event function in the code behing page.and javascript function doesnt allow me to refer to any control within the gridview.........PLZ HELP ME...............Thanx   You just place a...

converting Bound Column to Template Column
Hi All, I wanted to convert the bound column in the grid to Template column. How could I do this dynamically? I know it can be done using the edit column dialog box, but I need to do that in the code behind. waiting for your reply. Thanks, regards,   Hi Techwork, Not tested and incomplete but just to get you going: Iterate the Columns property and find the BoundField with:Columns[i].GetType().Name == "BoundField" and((BoundField)Columns[i]).DataField == ... Remove this BoundField from the Columns Collection with:Columns.RemoveAt(i); Create a new TemplateField insta...

GridView column data blanks in template field after using EDIT then UPDATE buttons...???
I have a gridview which is a detail level in a master/detail relationship.   Anyway the master level record Audits is selected and then all the AuditDetails display in this gridview. Everything works fine, and I use an EVAL statement to replace a few FK IDs with user friendly name fields instead. HOWEVER, once I EDIT/UPDATE a row (after it updates and the webpage reloads) the row I updated is MISSING data in the fields using the EVAL statement. If I click away and come back to the page the data appears again.  It is in the database but on refresh that EVAL field isn't gett...

Sorting column lost with Summary/Detail Gridviews & object data source
Hi,I'm using 2 object data sources to get data from a class and populate 2 seperate gridviews.  The first gridview is a summary and is populated on pageload.  When the select command is triggerd, the details gridview is populated based on the valud in the first column of the summary gridview.  The problem is that if I sort the second gridview, and then click select on the summary gridview on a different row, I get an error that the sort column name could not be found.  The column name is the name of the column that I sorted by in the details gridview.  For some r...

How to create GridView columns at run time using templates and bi-directional bound data
I want to generate editable GridView columns at run time, without using any data providers. I just want to crate an empty DataGrid on the page and later on will create its columns based on data. There are a number of posts but they are either too complex or do not provide what I need. Can anyone tell me how to create the exact same colums like the code below created in design time?   <asp:GridView ID="GridView1" runat="server" AllowSorting="True" > <Columns> <asp:TemplateField HeaderText="Admins"> ...

How to get Rows and Columns collection in a data bound server control, independent of DataSource attached.
Hi,   In my custom data bound server control (Inherited from existing server control). I need to get the column collection of the data source. I had tried to get the collection by   base.GetData()             This returns DataSourceView, which I can not enumerate to get rows and columns collection. I want to use it as DataTable/ DataView.   and base.GetDataSource()             This return IdataSource. I am not get...

Web resources about - Issue with Template Columns & Bound Columns while updating the data in a GridView control - asp.net.object-datasource

Template - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Facebook page template & tips for 2014
As Facebook page admins get started with 2014, the social marketing experts at ShortStack created a detailed template , including image sizes, ...

Frame Artist Pro - Best Photo Collage Editor, Stitch Your Photos with Pic Frame Templates & Filter Effect ...
Get Frame Artist Pro - Best Photo Collage Editor, Stitch Your Photos with Pic Frame Templates & Filter Effect & Frames on the App Store. See ...

Paper wireframe templates - Flickr - Photo Sharing!
jasonrobb.com/v2/i/Wireframe-templates-JasonRobb.zip jasonrobb.com

United Airlines accidentally sends letter template to unhappy passenger
A US air passenger may have received what is quite possibly the world’s least sincere apology letter.

TV Templates - Transcripts
Lorem ipsum dolor sit amet, aihiad adaph dpas, osaf das. Oi asdfpo ijafj ai.

Mockup Apple Watch apps and compare screen sizes with these official bezel templates
... for developers, readers interested in Apple Watch can also use the images to compare the overall physical size of the two sizes. The templates ...

Paper by FiftyThree makes starting new projects easier with templates
... FiftyThree has just received an update that significantly improves various aspects of its interface and functionality. Get started with templates ...

Windows 10 patch messing with your Office 2016 templates? Here's how you can get them back
... 10 patch has had some Word 2016 users cringing in despair. The patch, titled Cumulative Update KB3124200 , is causing the Word 2016 template ...

Templates, Insights and Dictation in Google Docs
Google's standalone web apps for Docs , Sheets and Slides now show a list of templates you can choose to quickly create a document, spreadsheet ...

Resources last updated: 1/16/2016 2:58:52 PM