473,408 Members | 2,888 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,408 software developers and data experts.

How do I create a dropdownlist in a gridview that doesn't use datasource

I'm using asp.net/vb and I have successfully created a gridview without datasource. However, I am having difficulty creating a dropdownlist on one of the columns in the gridview. Does anyone have any idea on this?
Thanks in advance...
~Haleigh
Jan 16 '07 #1
3 1174
kenobewan
4,871 Expert 4TB
You may use ItemTemplate, as outlined in this article:
Accessing the different controls inside a GridView control

Out of curiousity, what data are you binding the gridview to?
Jan 17 '07 #2
You may use ItemTemplate, as outlined in this article:
Accessing the different controls inside a GridView control

Out of curiousity, what data are you binding the gridview to?
I am using a stored procedured and then I used this code below to retrieve the changed values, and newvalues would not work..

Dim i As Integer
Dim cell As DataControlFieldCell

'This assignes a name to each text box
Dim myControls As ControlCollection = GridView1.Rows(e.RowIndex).Controls
For Each cell In myControls
cell.Controls(0).ID = "Field" & i.ToString
i += 1
Next

Dim tbStartDt As TextBox = CType(row.FindControl("Field4"), TextBox)
Dim strStartDt As String = tbStartDt.Text


.. but now I'm having problems getting dropdownlist to work, any ideas?
Jan 17 '07 #3
kenobewan
4,871 Expert 4TB
I suggest calling the dropdownlist directly and using the datatextfield and datavaluefield...

Hope that this helps.
Jan 18 '07 #4

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

Similar topics

0
by: dawg1998 | last post by:
I am able to populate a DropDownList control within multiple rows of a GridView with the following code: `````````````````````````````````````````````````````` <asp:GridView id="gvGridView"...
0
by: den 2005 | last post by:
Hi everybody, I created a Gridview with a TemplateField and there is Label control in ItemTemplate and a DropdownList control in EditItemTemplate, I was to displayed them ok when I click the...
1
by: mitchman10 | last post by:
My Time table has TimeID,Employee,PayPeriod,ChargeCodeID,Hours My Chargecode table has ChargecodeID,c_Text I need an Editable datagrid that will show the TimeID,Employee,PayPeriod,C_Text in a...
0
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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,...
0
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
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...

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.