473,321 Members | 1,877 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

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

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_rowdatabound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView5.RowDataBound
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.Columns.Count
strSuburb = (Trim(GridView5.Columns(i).ToString()))
strSuburb = strSuburb.ToUpper()
If (strSuburb = "SUBURB") Then

Exit For
End If

Next
If e.Row.RowType = DataControlRowType.DataRow Then

Dim Ourddl As DropDownList = CType(e.Row.FindControl("dropdownlist3"), DropDownList)
Columns = myValidation.ReturnMoreThanOneSuburbSelect(strServ er, strUsername, strPassword, Trim(e.Row.Cells(1).Text), Trim(e.Row.Cells(2).Text))
Ourddl.DataSource = Columns
Ourddl.ForeColor = Drawing.Color.Red
Ourddl.DataBind()
AddHandler Ourddl.SelectedIndexChanged, AddressOf Ourddl_SelectedIndexChanged
Columns = myNewColumn.Split(",")
For x = 0 To Columns.Length - 1
strSuburb = (Trim(Columns(x).ToString()))
strSuburb = strSuburb.ToUpper()
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 1532

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

Similar topics

0
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...
6
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...
8
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 :...
1
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. ...
2
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...
0
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...
0
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...
4
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...
1
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.