473,386 Members | 1,791 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,386 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 1614
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
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...
0
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...

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.