473,471 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

DropDowns in GridView

MRW
I have a GridView which displays simple labels in ItemTemplate, and
when it goes to EditTemplate, one field is a dropdown list and the
other is a text box.

On gvTT_RowUpdating(..), I'm able to access the text box without any
issue, using:

Dim newDate As TextBox = gvTT.Rows(gvTT.EditIndex).FindControl("Date")

However, for the dropdown, when I use:

Dim ddlCategories As DropDownList =
gvTT.Rows(e.RowIndex).FindControl("ddlCategories")

I can access all the properties of the dropdown (being it's finding
it), however, I cannot access the selected value!

Response.Write(ddlCategories.SelectedIndex)

Does anybody know why I cannot access the dropdown list, yet I can
access the text boxes???

Thanks for ANY help!

Jul 17 '07 #1
4 1401
On Jul 17, 11:17 am, MRW <mwin...@yahoo.comwrote:
I have a GridView which displays simple labels in ItemTemplate, and
when it goes to EditTemplate, one field is a dropdown list and the
other is a text box.

On gvTT_RowUpdating(..), I'm able to access the text box without any
issue, using:

Dim newDate As TextBox = gvTT.Rows(gvTT.EditIndex).FindControl("Date")

However, for the dropdown, when I use:

Dim ddlCategories As DropDownList =
gvTT.Rows(e.RowIndex).FindControl("ddlCategories")

I can access all the properties of the dropdown (being it's finding
it), however, I cannot access the selected value!

Response.Write(ddlCategories.SelectedIndex)

Does anybody know why I cannot access the dropdown list, yet I can
access the text boxes???

Thanks for ANY help!
hi,
did you try this
gvTT.Rows(e.RowIndex).FindControl("ddlCategories") .SelectedItem.Value
hope it will work

thanks
nahid
http://nahidulkibria.blogspot.com/
http://www.kaz.com.bd

Jul 17 '07 #2
MRW
hi,
did you try this
gvTT.Rows(e.RowIndex).FindControl("ddlCategories") .SelectedItem.Value
hope it will work

thanks
nahidhttp://nahidulkibria.blogspot.com/http://www.kaz.com.bd
Yes I did and same result...

Jul 17 '07 #3
MRW
Thanks for the response. However, I did try that out as well with the
same results.

nahid wrote:
On Jul 17, 11:17 am, MRW <mwin...@yahoo.comwrote:
I have a GridView which displays simple labels in ItemTemplate, and
when it goes to EditTemplate, one field is a dropdown list and the
other is a text box.

On gvTT_RowUpdating(..), I'm able to access the text box without any
issue, using:

Dim newDate As TextBox = gvTT.Rows(gvTT.EditIndex).FindControl("Date")

However, for the dropdown, when I use:

Dim ddlCategories As DropDownList =
gvTT.Rows(e.RowIndex).FindControl("ddlCategories")

I can access all the properties of the dropdown (being it's finding
it), however, I cannot access the selected value!

Response.Write(ddlCategories.SelectedIndex)

Does anybody know why I cannot access the dropdown list, yet I can
access the text boxes???

Thanks for ANY help!

hi,
did you try this
gvTT.Rows(e.RowIndex).FindControl("ddlCategories") .SelectedItem.Value
hope it will work

thanks
nahid
http://nahidulkibria.blogspot.com/
http://www.kaz.com.bd
Jul 17 '07 #4
MRW
Thanks for the reply! However, this was one of the things I tried
with no success...

On Jul 17, 1:37 pm, nahid <nahid...@gmail.comwrote:
On Jul 17, 11:17 am, MRW <mwin...@yahoo.comwrote:
I have a GridView which displays simple labels in ItemTemplate, and
when it goes to EditTemplate, one field is a dropdown list and the
other is a text box.
On gvTT_RowUpdating(..), I'm able to access the text box without any
issue, using:
Dim newDate As TextBox = gvTT.Rows(gvTT.EditIndex).FindControl("Date")
However, for the dropdown, when I use:
Dim ddlCategories As DropDownList =
gvTT.Rows(e.RowIndex).FindControl("ddlCategories")
I can access all the properties of the dropdown (being it's finding
it), however, I cannot access the selected value!
Response.Write(ddlCategories.SelectedIndex)
Does anybody know why I cannot access the dropdown list, yet I can
access the text boxes???
Thanks for ANY help!

hi,
did you try this
gvTT.Rows(e.RowIndex).FindControl("ddlCategories") .SelectedItem.Value
hope it will work

thanks
nahidhttp://nahidulkibria.blogspot.com/http://www.kaz.com.bd

Jul 18 '07 #5

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

Similar topics

2
by: Crescionini Sascha | last post by:
Hello NG If I let appear a DIV over a HTML site with dropdowns, this dropdowns are still visible. Is there a way to push them to the back? All other form elements arent visible. greets...
0
by: Jeffrey | last post by:
Hi... I have several dropdowns located in a datagrid footer. Now say i modify the selection in dropdown1. I want to refresh the content of the other dropdowns with the result of a database...
3
by: Damon | last post by:
I am working on a site in which I would like to have two dropdowns that will allow a user to navigate through the administrative pages of the site. The first would allow the user to choose the...
1
by: Andy | last post by:
What I want to do is to populate multiple dropdowns when editing. Presumably... a) I should use a DataReader so that I can get each ResultSet for each dropdown control, and that should cut down...
4
by: DXJas | last post by:
I have a form that calls a stored procedure to perform updates to a table in sqlserver. When I have a dropdown with a list item value of nothing, the formview control passes up the wrong value...
3
by: Simon Harvey | last post by:
Hi everyone, I keep getting a problem with dropdownlist controls. It sounds really stupid, but my app is screwed as long as this keeps happening. It seems to spontaneously happen and then I...
1
by: Chris | last post by:
I am programatically binding a datasouce to a dropdown. It is the names of employees that meet certain criteria. In the database they are stored as forename and surname. Aside from concatenating...
0
by: bogorman | last post by:
Am trying to add a "video" to a webpage which is based on a template containing a javascript menu. The site has hundreds of pages all based on this template and the menu works fine The page can be...
0
by: sbart | last post by:
I am programing in asp.net vb using AjaxToolkit cascadingDropDown. I do not have access to AjaxToolkit cascading dropdown event handlers. I have a series of dropdowns. The selection from one of...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
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...
0
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,...
0
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
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...
0
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 ...
0
muto222
php
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.