Solved

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

Posted on 2013-06-26
2
631 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:Mariyam
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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:Mariyam
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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
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 …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

624 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