473,382 Members | 1,657 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,382 software developers and data experts.

Bound Control

Hello, when you have bound a datatable to a control, say a comboBox and you
have set the "ValueMember" and the "DisplayMenber". The cbo.SelectedValue
returns the object which equates to the "ValueMember", but how do you
retrieve the object which is associated with the Display Member? I have
tried cbo.SelectedText, but that does not seem to do...I have tried
cbo.SelectedItem...but again does not seem to do it which the control is
bound.

This only way that I have found to get the value is to use the
cbo.SelectedIndex and use this as a pointer back into the DataTable which
is bound to the control. Surely there is a better way....

What is the difference between selected Text and Selected Item?

Thanks in advance for your assistance!!!!!!!!!!!!
Nov 15 '05 #1
1 1613
Hi Jim

Have you tried 'cbo.Items[cbo.SelectedIndex]

thank
Nithin P

----- Jim Heavey wrote: ----

Hello, when you have bound a datatable to a control, say a comboBox and you
have set the "ValueMember" and the "DisplayMenber". The cbo.SelectedValue
returns the object which equates to the "ValueMember", but how do you
retrieve the object which is associated with the Display Member? I have
tried cbo.SelectedText, but that does not seem to do...I have tried
cbo.SelectedItem...but again does not seem to do it which the control is
bound

This only way that I have found to get the value is to use the
cbo.SelectedIndex and use this as a pointer back into the DataTable which
is bound to the control. Surely there is a better way...

What is the difference between selected Text and Selected Item

Thanks in advance for your assistance!!!!!!!!!!!

Nov 15 '05 #2

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

Similar topics

4
by: Aaron Ackerman | last post by:
I am using typed datasets in an N-Tier Windows app using VB.NET. I know this posting cannot be fully explained in a single post that is why I am asking for someone to point me to a real world...
3
by: PAUL EDWARDS | last post by:
I have a windows form that is bound to a datatable. In VB6 I could just update the field contents and it would be updated in the database, however if I update the text property of the control from...
0
by: Maurice Mertens | last post by:
Hi, I'm having some troubles with bound controls on a windows form. When I start the form, the dataset gets filled with records. Then the controls on the form are bound to fields in the dataset....
19
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate...
1
by: DrFoo | last post by:
Hi, I'm trying to check for a unique value index violation on a bound field when done editing the field (before update, on exit, on lost focus, etc), and when I find a violation change the value...
6
by: BBM | last post by:
Hi, I'm having trouble getting control data binding to work. As I understand it, the simplest form of databinding requires three things: 1) A control (say a textbox) on a form or user...
0
by: HP | last post by:
Hi there I have a datalist control with some bound controls in its Item Template and a gridview bound to one of those fields (residing also in Item Template). I've found out that when I click...
1
by: nassersh | last post by:
I am using a bound control to embed word documents within an access form. I have created two buttons on the form One to embed aand display and one to close. I embed one doc and then save the doc...
6
by: Jonathan Wood | last post by:
I have a databound dropdownlist control. Based on some other criteria, I need to specify the selected item in my pages Load event. The problem is that, in my load event, the control does not yet...
0
by: Mike | last post by:
So here's the situation (.NET 2.0 btw): I have a form, and on this form is a textbox among many other databound controls. The textbox is bound to a field in a data table via the Text property. ...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.