473,804 Members | 3,809 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to get value from nested Dropdownlist in Gridview for gridview.column .cell (x)

28 New Member
Hi everyone
I have a problem when I want to edit the value from nested dropdownlist in Gridview, Please, anyone can help me to solve this problem, a great appreciation from me in advance.
here is my sample code ASP.NET with VB.NET
Protected Sub gridview5_rowda tabound(ByVal sender As Object, ByVal e As System.Web.UI.W ebControls.Grid ViewRowEventArg s) Handles GridView5.RowDa taBound
Dim Columns() As String
Dim myDataset As New DataSet()
Dim i As Integer = 0
Dim x As Integer = 0
Dim strSuburb As String
For i = 0 To GridView5.Colum ns.Count
strSuburb = (Trim(GridView5 .Columns(i).ToS tring()))
strSuburb = strSuburb.ToUpp er()
If (strSuburb = "SUBURB") Then

Exit For
End If

Next
If e.Row.RowType = DataControlRowT ype.DataRow Then

Dim Ourddl As DropDownList = CType(e.Row.Fin dControl("dropd ownlist3"), DropDownList)
Columns = myValidation.Re turnMoreThanOne SuburbSelect(st rServer, strUsername, strPassword, Trim(e.Row.Cell s(1).Text), Trim(e.Row.Cell s(2).Text))
Ourddl.DataSour ce = Columns
Ourddl.ForeColo r = Drawing.Color.R ed
Ourddl.DataBind ()
AddHandler Ourddl.Selected IndexChanged, AddressOf Ourddl_Selected IndexChanged
Columns = myNewColumn.Spl it(",")
For x = 0 To Columns.Length - 1
strSuburb = (Trim(Columns(x ).ToString()))
strSuburb = strSuburb.ToUpp er()
If (strSuburb = "SUBURB") Then

Exit For

End If
Next

e.Row.Cells(i + x + 2).Controls.Add (Ourddl)
End If


End Sub
Mar 19 '08 #1
0 1554

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2213
by: hammad.awan_nospam | last post by:
Hello, I am using ASP.NET 2.0. What I have done is nested a gridview inside another column of a gridview using a template data field column declaritively in my web form. Inside this child gridview I have set an ItemStyle property of width 20% for the first templated field which contains a hyperlink control, and an ItemStyle of width 80% for the second templated field which contains a label. Both of these controls are databound to...
6
8276
by: Dabbler | last post by:
I have a dropdownlist in a GridView ItemTemplate. I need to bind the ddl to an SqlDataSource, then have a value from a boundfield in the row be passed as the keyfield for select where clause. Im trying to load the ddl with a list of dates from another table keyed on GridView row field that only apply to this row. Any suggestions would be appreciated.
8
14784
by: graphicsxp | last post by:
Hi, How can I get the value of a cell that belongs to a hidden column of gridview ? Here's how I normally access the value of a cell, but it doesn't work if the column is invisible: Code : Me.grdPublication.SelectedRow.Cells(1).Text I've used a gridview with auto-generated columns to false, so I can
1
14317
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. Both the grid and the dropdown box are retrieving and displaying data fine, I just cant bind the two together. I followed the instructions in the help document called 'Walkthrough: Displaying a Drop-Down List While Editing in the GridView Web...
2
1636
by: OJ | last post by:
Hi, ASP.NET C# 2.0 I have a usercontrol which contains a Gridview. I create my own DataTable to bind to the GridView, which then fires the RowDataBound event of the the Gridview. Here I add a dropdownlist to the relevent row.Cell. I then expose the GridView as a public property of the usercontrol. This all works lovely. However, when I try to find the dropdownlist by accessing the GridView property of the usercontrol on the ASP next...
0
2441
by: landesjoe | last post by:
Hi, here's my problem in short: Text boxes in gridview don't seem to hold their value if the column's .Visible property is changed back and forth. I've got a form with a gridview populated from a data view (which in turn is loaded from a manually setup DataTable for testing purposes). One of the columns in the grid is a checkbox that's tied to an event handler that'll change the .Visible property of a column with a text box. That text...
0
5963
by: sgtmarcjones | last post by:
How do I access a dropdownlist that is nested within a Formview ItemTemplate Gridview Template? I want to see a label (lgbTimeKeep ! TextValue of ddlName dropdownlist) instead of a dropdownlist in the FormView ItemTemplate Nested Gridview ddlName ItemTemplate. My label is named lgvTimeKeep and the dropdownlist name is ddlName. Thanks!
4
5917
by: pvong | last post by:
Hi, I'm a newbie and I'm looking for some help. I'm programming in VB.Net. I have a simple gridview and when the user hits the Edit link, the gridview changes to edit mode. I replaced the Textboxes with labels and I turn off the Update command because I want to write my own update command. I can not figure out how to pull the value from a cell in the row the user hit Edit on. Example: User hits edit on row 10 and the value I want to...
1
3026
by: iswar | last post by:
Hi friends.. Im trying to bind a value from dropdownlist placed in gird view to another cell. i want to update a database field with the selected value from dropdownlist and which must be bind to gridview... please help me .. im using sql server2000 as datasource.. public partial class Propertydetails : System.Web.UI.Page { protected static string connect; string ct, struName; protected void Page_Load(object sender,...
0
9577
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10325
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10315
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6847
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4295
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 we have to send another system
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.