473,799 Members | 2,727 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Get object from DropDownList bound to object

Hi

I have an array of object.
I am binding this array to a dropdownlist

On the dropdown's selected index changed, can i retrieve the object from the
selected value.
I know i can get the text and value, but is it possible to get the object
from the datasource

something along the lines of:
SomeObject so = (SomeObject)dro pdown.DataSourc e;

When i try this i see the DataSource is null;

TIA
TIA
Jun 30 '06 #1
1 3135
Wouldn't it be

SomeObject so = (SomeObject)dro pdown.SelectedI tem;
--
Robbe Morris - 2004-2006 Microsoft MVP C#
Earn money answering .NET questions
http://www.eggheadcafe.com/forums/merit.asp

"Grant Merwitz" <gr***@workshar e.comwrote in message
news:%2******** *******@TK2MSFT NGP03.phx.gbl.. .
Hi

I have an array of object.
I am binding this array to a dropdownlist

On the dropdown's selected index changed, can i retrieve the object from
the selected value.
I know i can get the text and value, but is it possible to get the object
from the datasource

something along the lines of:
SomeObject so = (SomeObject)dro pdown.DataSourc e;

When i try this i see the DataSource is null;

TIA
TIA

Jul 6 '06 #2

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

Similar topics

3
1730
by: Bill | last post by:
I have a seating chart web form that has over 50 entry field controls (tables/booths) where I use a DropDownList box to select a single company name from a single large list of organizations (200 plus conference attendees). All web form datavalues will be one of the same 200 organizations in this list. I would like to avoid creating 50 separate exact copies of the same DataSet object. Can you help? Q. Exactly how do I use the same...
0
1074
by: Kimberly Walker | last post by:
Im farily new to the .Net so please bear with me. I have several dropdownlist that is bound to a sql string. For example dim sqlstring as string="Select books from SuborgT where books=New" I then bind this and it gives me the "new" in the dropdownlist. What I need is just like in a combobox in Ms Access is to not only give you the source but you can also create the record source in it. I need for the dropdownlist to include "Old", and...
1
2326
by: Stuart Ferguson | last post by:
I am currently writing a screen in my application which uses a form view control bound to an ObjectDataSource, the Business Layer is using a custom class to overcome passing mutiple parameters to the business layer however when the control in the FormView is a DropDownList it seems the values are not passed through in the Update Method, either in the updated copy of the class or the original copy, has anyone else came accross this problem....
0
1374
by: Dossman | last post by:
I am somewhat new to ASP.NET. Classic ASP/SQL Server experience mostly. I have a DetailsView control with a DropDownList on an EditItemTemplate. The DropdownList shows in place of a bound Textbox. The idea is to show the user the data in a bound textbox field, but show a dropdownlist on Edit. The Dropdownlists' datasource is the vw_aspnet_membershipUsers table in the database showing only the username field. The selected data needs to go...
1
1352
by: jkeel | last post by:
I have two ddl's in a formview which is bound to an objectdatasource. Each of the ddl's have there datasource propertys set to a function which returns a dataset. The selected index of each of the dropdownlist is set to a property returned from the objectdatasource. When I change the selectedindex property of the first dropdownlist I need to pass the selectindexed of that dropdownlist into the function that the second dropdownlist is...
0
9689
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10269
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10032
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5469
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5597
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4148
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 we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2942
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.