473,503 Members | 1,783 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Gridview with DropDownList

I am trying to use a dropdownlist inside of a gridview. I want the
gridview to display some value as a label until the user clicks the
edit button for that row. Then I want to populate the dropdownlist
with some values from a table. I have tried a few different
approaches and have not been able to get anything to work. Can
someone tell me what the "best" approach is? I can then try it or
post the code I'm having trouble with.

Thanks

Ryan

Aug 21 '07 #1
2 1285
Hello,

If you are using ASP .net 2.0, it's easy, create two item templates one for
edit and the other for editing, in the other hand and the dropdown in the
editing one, about how this works:

http://www.gridviewguy.com/ArticleDe...?articleID=169
http://www.bdiez.com/tips/GridView_1.htm

Another thing a bit more difficult is to use cascading combos.

Good Luck
Braulio

/// ------------------------------
/// Braulio Diez
///
/// http://www.tipsdotnet.com
/// ------------------------------


"rw*****@iastate.edu" wrote:
I am trying to use a dropdownlist inside of a gridview. I want the
gridview to display some value as a label until the user clicks the
edit button for that row. Then I want to populate the dropdownlist
with some values from a table. I have tried a few different
approaches and have not been able to get anything to work. Can
someone tell me what the "best" approach is? I can then try it or
post the code I'm having trouble with.

Thanks

Ryan

Aug 21 '07 #2
Here's a code sample from ASPNet101.com:
http://www.aspnet101.com/aspnet101/a...ode=EditDDL_GV

David Wier
http://aspnet101.com
http://iWritePro.com
<rw*****@iastate.eduwrote in message
news:11*********************@x40g2000prg.googlegro ups.com...
>I am trying to use a dropdownlist inside of a gridview. I want the
gridview to display some value as a label until the user clicks the
edit button for that row. Then I want to populate the dropdownlist
with some values from a table. I have tried a few different
approaches and have not been able to get anything to work. Can
someone tell me what the "best" approach is? I can then try it or
post the code I'm having trouble with.

Thanks

Ryan

Aug 21 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
6981
by: mateo | last post by:
Hello, I have a GridView inside which i want to show 3 dropdownList (one for each Column). So i've created 3 TemplateField Continent Country City
1
3223
by: Giovanni | last post by:
Dear Friends/Gurus, I have exhausted myself and have yet no solution to the following: I have an ASP.NET 2.0 Survey type application. On a page, I have placed a GridView which is bound to an...
1
14298
by: CorporateCoder | last post by:
Hi, I am trying to bind the selected value of a databound dropdown box in a databound gridview control to the value being displayed in the template column the dropdown box has been added to. ...
0
1549
by: Frank | last post by:
Hello All, I am working with VS.NET 2005 and I have an editable GridView whose HTML markup is shown below. In short, when the user clicks on the Edit button, one of the textboxes is replaced...
5
25289
by: maurban | last post by:
Hi there experts, I have a gridview with a couple textboxes and a dropdownlist. I'm trying to insert a default value into my database driven dropdownlist. I'm doing this in the rowdatabound...
5
2966
by: Andrew Robinson | last post by:
I am attempting to better automate a Pager Template within a GridView. I am succesfully skinning a Drop Down List withing my control (the DDL is added to my control). I correctly populate the item...
0
2207
by: lamolap | last post by:
i have 1 gridview , a dropdownlist inside a gridview and a commandfield of (edit, update and cancel) my gidview looks like this Edit Surname Initials ...
0
1365
parshupooja
by: parshupooja | last post by:
Hi all, I need help. I am using asp.net C# . I have binded gridview with 5 columns. I have Dropdownlist in 4 columns Morning in, morning out, afternoon in and afternoon out and label in 5 column...
0
1862
by: Fabrizio | last post by:
Hi all. I have a field in a gridview as templatefield which is a label in view mode and a dropdownlist in edit mode with his datasource. This gridview is inserted as templatefield in another...
6
4254
by: Ahmedhussain | last post by:
Hi there, I m doing work on a gridview and Im getting an error: A potentially dangerous Request.Form value was detected from the client (ctl00$Content$GridView1$ctl03$TextBox1="<span...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7330
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7460
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.