Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 7th, 2007, 01:34 PM
Registered User
 
Join Date: Dec 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default .net 1.1 dropdownlist in datagrid

I have my dropdown list in the edit template populated with the correct information. I need to know how to set it to the specific value that the corresponding label contains.
When I try to update using the value given I get the message Object reference not set to an instance of an object.

Any help would be appreciated. I've use the code off the 4 guys from rolla site and this is as far as I could get.

 
Old December 7th, 2007, 03:02 PM
Registered User
 
Join Date: Dec 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've been successful in getting the selected value into the dropdownlist, still no luck getting the value with the Update command

 
Old December 7th, 2007, 03:09 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

When you go to update your data you need to get a reference to your control, something like:

public void grid_Update(object sender, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
DropDownList d = (DropDownList)e.Item.Cells[x].Controls[x];
}

hth

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
Datagrid Dropdownlist unable to get value ChuckHarkness ASP.NET 1.0 and 1.1 Professional 0 January 23rd, 2007 09:32 AM
dropdownlist inside datagrid myunus General .NET 11 October 29th, 2006 07:37 AM
dropdownlist in datagrid ansowmya ASP.NET 1.0 and 1.1 Basics 1 June 14th, 2006 02:49 PM
dropdownlist in datagrid ansowmya ASP.NET 2.0 Basics 0 June 10th, 2006 10:29 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.