473,466 Members | 1,565 Online
Bytes | Software Development & Data Engineering Community
Create 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)dropdown.DataSource;

When i try this i see the DataSource is null;

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

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

"Grant Merwitz" <gr***@workshare.comwrote in message
news:%2***************@TK2MSFTNGP03.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)dropdown.DataSource;

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
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...
0
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...
1
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...
0
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....
1
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...
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
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: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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 ...

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.