Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 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 April 15th, 2004, 04:06 PM
Registered User
 
Join Date: Apr 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default DataGrid and DropDown

I Just started working in asp.net

I have a datagrid. I am Editing the DataGrid and displaying that values in some other aspx page. For Example edit Page and saving the values into datagrid. I am OK until this Point. But when ever I come back to edit page. My drop down value is always the first one. I want the value to be selected one which is in data grid. Why is this happening. Please help me.

 
Old April 17th, 2004, 12:56 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

u should set their values on page loading.

Always:),
Hovik Melkomian.
 
Old April 19th, 2004, 09:01 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

What exactly do you mean by "saving the values into datagrid"? You can't save values to a datagrid.

When your edit page loads and you bind the dropdown list, you need to find the value in the dropdownlist and mark that select item as selected. I usually do this like this:

ddlList.SelectedIndex = ddlList.Items.IndexOf(ddlList.Items.FindByValue(sS electedValue))

Peter
-------------------------
Work smarter, not harder





Similar Threads
Thread Thread Starter Forum Replies Last Post
Dependent DropDown In DataGrid software_developer_kk ASP.NET 1.0 and 1.1 Professional 3 January 29th, 2007 03:13 AM
Dropdown list in a datagrid maddy137 ASP.NET 1.0 and 1.1 Professional 0 May 19th, 2006 02:05 PM
datasource for dropdown in datagrid msrnivas General .NET 1 August 8th, 2005 08:17 PM
DropDown in DataGrid kiranpanjala Classic ASP Databases 0 January 24th, 2005 10:54 AM
select value of a dropdown in a datagrid Sbartis ASP.NET 1.0 and 1.1 Professional 2 January 14th, 2005 05:19 PM





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