472,362 Members | 1,783 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Binding Dynamically Named Drop Downs in a Repeater

I have searched high and low for a solution to this and I dont think
its possible.... but I hope not.

What I have is a list of items with various values that can be changed
via a drop down. Each of the items will have a value that was
previously selected by the user. When the data is displayed, the
previously selected values must be set as the default in the drop down.

The ids of each drop down are created acording to their index in the
backend list that is bound to the repeater.

Heres a snipit...

<asp:Repeater id="items">
<aspDropDown id="size<%#getIndex()%>" datasource="<%#
container.dataitem.sizes %>"/>

container.dataitem.sizes returns a object that implments IList
getIndex returns an counter then increments it


1) The datasource property for the drop down ends up being set to a
string denoting the type of object returned by the sizes property. i.e.

2)How to set the selected item in the given drop down to a value based
on something like container.dataitem.selectedsize. Since the name of
the control is named at bind time, using any of the repeater events
seems to be useless unless the index can be passed to them.

Is there a way to pass the dropdown object to a function like
<aspDropDown id="size<%#getIndex()%>" datasource="<%#

where I can then set the default value and bind the list..?
Also, the repeater doesnt offer an index to determine how many elements
are currently bound? Something like <%#container.index%>???

Thanks in advance, I hope this stuff is possible.

Nov 23 '05 #1
0 1506

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

Similar topics

by: Kingdom | last post by:
In my data base I have a list of componet types e.g. type A - I have 8 off - type B I have 12 off etc. I'm using Set objRS = objDC.Execute("Select DISTINCT Component_Type FROM Parts_Table") ...
by: Tim T | last post by:
Hi, I have the need to use dynamically loaded user controls in a webform page. I have the controls loading dynamically, and that part works fine. this is the code used in a webform to dynamically...
by: Gastin | last post by:
I am consuming a web serivce from Amazon.Com. I have the following class which was autogenerated by VS.NET when I created a Web Reference to...
by: BryanS | last post by:
I am having trouble trying to link 2 drop down lists and a repeater control. What i want is 2 drop down lists, the first being a list of food categories. When a category is selected the second...
by: Amit | last post by:
Hello, I have a simple search screen, with two drop-downs and a text box. There's also a GridView control that is using a SqlDataSource control to show the matching results. The SqlDataSource uses...
by: CSharpguy | last post by:
I have 3 drop downs that are populated from the databasem 4 of my web pages need to have this drop down, how can I trap the selection made in the drop down and popuate my grid on my form?
by: Ken | last post by:
Hi I have a little application that does datavalidation. It supports dynamically loaded plugins (you drop a dll with a class implementing IValidator<Tin the same dir as the main application)....
by: ehsanen | last post by:
I have some text boxes and drop downs on my web page and now i want to put a button in my webpage that when the user clicked the buton the page itself add another row of textboxes and drop downs , in...
by: DotNetNewbie | last post by:
Hi, It is not possible to bind a Generic.List collection to a repeater I guess huh? I am getting this error: An invalid data source is being used for rpCategories. A valid data source must...
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...

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.