Solved

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

Posted on 2013-06-26
2
609 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
ID: 39280186
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
ID: 39292362
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Class Library Dynamics For Connectstring Information 2 20
Problem to go to Web page 2 93
ASP.NET Web API or ASP.NET Core MVC? 3 51
error on the asp.net page 1 33
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

914 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

24 Experts available now in Live!

Get 1:1 Help Now