Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language 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 May 3rd, 2010, 06:30 AM
Authorized User
 
Join Date: Mar 2010
Posts: 27
Thanks: 2
Thanked 1 Time in 1 Post
Default Select value of DropDawnList Inside GridView

Code:
FormView1.FindControl("TextBox2") as TextBox;
I need like it to select the value for DrowpDownList inside GridView
 
Old May 3rd, 2010, 07:20 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Please check the following link:
http://forums.asp.net/p/1117644/1736466.aspx

Example:
Dim ddl As DropDownList = DirectCast(sender, DropDownList)
' add an empty item on top of the list
AddEmptyItem(ddl)
Dim gvRow As GridViewRow = DirectCast(ddl.NamingContainer, GridViewRow)
If Not gvRow.DataItem Is Nothing Then
Dim
strModel As String = DirectCast(gvRow.DataItem, System.Data.DataRowView)("Model").ToString
ddl.ClearSelection()
Dim li As ListItem = ddl.Items.FindByValue(strModel)
If Not li Is Nothing Then li.Selected = True

End If
__________________
Om Prakash Pant
Click the "Thanks" button if this post helped you.
 
Old May 6th, 2010, 06:28 AM
Authorized User
 
Join Date: Mar 2010
Posts: 27
Thanks: 2
Thanked 1 Time in 1 Post
Default

please see the following url
http://tareemnet.com/drop.JPG

User Name : adnet
Pass : 123

When Editting, the user can change the value using the dropdownlist, and then updating with that new value selected.
I'm beginner, please provide me a full code in c# for that issue.
 
Old May 6th, 2010, 06:33 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

You may want to check out my books Beginning ASP.NET 3.5 or Beginning ASP.NET 4 as they both cover these scenarios in detail. See the links to them in my signature.

Asking for "a full code in c#" is usually not the way it works, but YMMV of course.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to tie to nested GridView inside DataList rsearing ASP.NET 2.0 Basics 6 June 18th, 2011 06:35 AM
Two DropDownList Inside a Gridview ilayaraja ASP.NET 3.5 Basics 3 December 5th, 2008 06:26 PM
Select row in GridView WITHOUT using Select button rao965 ASP.NET 2.0 Professional 1 February 15th, 2008 10:44 AM
TextBox inside GridView michurin ASP.NET 2.0 Basics 2 January 13th, 2007 12:51 PM
DropDownList inside a GridView aidoco ASP.NET 2.0 Basics 0 October 13th, 2006 04:24 AM





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