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

DropDownList (bind)

Hi.

I have a repeater that is binded with data.

For each data row I want the user to be able to change a
field, that is represented by a DropDownList.

My problem is that when binding the DropDownList I am not
able to select a default item that is at an index != 0
(zero).

Here is the code when binding the dropdown:

_dropdown.DataSource = _dataTable
_dropdown.DataTextField = "myTextField"
_dropdown.DataValueField = "myValueField"
_dropdown.DataBind()

_dropdown.Items.FindByValue(_myValue).Selected = True

these instructions are called in an overload method that
is triggered everytime a repeater item is created.
thank's in advance
goncalo

Nov 18 '05 #1
0 771

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

Similar topics

2
by: Brennon Arnold | last post by:
I have a problem that I figured would be relatively common, but have been unable to find any information on it as of yet. I have a page that contains two DropDownList controls, with the second...
18
by: Julia Hu | last post by:
Hi, I have a datagrid, and in different rows I need to programmatically bind different type of controls and load data into these controls. For example,in the first row I need to bind data into a...
2
by: COHENMARVIN | last post by:
I'm leafing through a big book on asp.net, and I don't see any way to the following: 1. bind values and text to a dropdown 2. Also make the first line of the dropdown say something different. For...
1
by: mr2_93 | last post by:
Hi All, I am new to ASP.NET and I am looking for help with the dropdownlist data control. I wonder if someone could show me how to past the SelectedValue of a data-bind dropdownlist to...
1
by: Patrik Zdarsa | last post by:
Hi, I'm try VS 2005 and need UPDATE database record in viewform, all working when every filed is type TextBox (html INPUT) but I need change one TextBox to Listbox or dropdownlist and read data...
4
by: P. Yanzick | last post by:
Hello, I've been playing with master/detail views as well as editing in the gridview, and I ran across a strange problem that I am not exactly sure where to go to try to solve. I have 2...
11
by: Santosh | last post by:
Dear all , i am writting following code. if(Page.IsPostBack==false) { try { BindSectionDropDownlist();
4
by: J055 | last post by:
Hi I thought I was trying to do something very simple but I'm have a lot of trouble trying to do the following. <asp:FormView ID="fvGroups" runat="server" DataKeyNames="GroupID"...
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...
2
by: teddymeu | last post by:
Hi Guys, this is kinda complicated but ill do my best to explain. I have two tables. products and categories. Products holds product info and an image, its primary key is ProductID. Category table...
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
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: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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: 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.