Solved

DropDownList in ASP.NET Gridview Not Saving Changes Made During UPDATE

Posted on 2013-06-26
2
605 Views
Last Modified: 2013-07-02
I've taken a gridview and replaced several of the fields with dropdownlists.

The Gridview is bound to a SQLDataSource and the dropdownlists are bound to a different SQLDataSource.  Generally I autoload all of the lookup table values into a dataset on page_load and bind my controls to the specific tables in the dataset.  The problem I'm having is because the ddls are inside of the gridview and I can't figure out why the selectedvalue  isn't being saved when I click on the UPDATE button.  It's wasn't originally throwing an exception it's just wasn't saving.  Now it's throwing an exception stating it "Cannot insert the value NULL".  Column does not allow nulls.

Where should I begin troubleshooting this?
0
Comment
Question by:FoxProMari
2 Comments
 
LVL 12

Accepted Solution

by:
duttcom earned 360 total points
Comment Utility
Ideally, you should have placed the ddls for editing the data inside an EditTemplateItem inside a template field in the Gridview.

This is a good walkthrough of implementing ddls in a gridview for editing -

http://msdn.microsoft.com/en-us/library/ms178294(v=vs.80).aspx
0
 

Author Closing Comment

by:FoxProMari
Comment Utility
The link you referenced is the exact one I used for testing - the problem for me seems to be that since the data that populates the ddls comes from tables different than the gridview sqlds table.

I got it working in 2005, but still no go on 2010.  I'm going to go ahead and complete the framework in 2005 and once it's table see about what advantages vs2010 offers (like AJAX for example).

Thanks so much.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video discusses moving either the default database or any database to a new volume.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now