Questions tagged [valuemember]
53 questions
7
votes
1 answer
Getting ValueMember from selected item in a ListBox with C#
I'm trying to get all the selected items ValueMember from a ListBox with C#.
For ex.:
I've a list like this:
ID | Name and Lastname
----------------------
1 | John Something
2 | Peter Something2
3 | Mary Smith
This structure is part of my…

Lucas
- 383
- 1
- 5
- 17
6
votes
2 answers
How to select ListBox item by ValueMember
I have two items with the same DisplayMember, but a different ValueMember and want to select one of the two items programmatically, how do I do this?
Items:
123 -> Peter Pan
234 -> John Doe
345 -> Peter Pan
I cannot select the last "Peter Pan" by…

Michael van der Horst
- 510
- 1
- 7
- 16
5
votes
2 answers
c#: how to set combobox valuemember from linq query
ok so i have combobox whos datasource are the results of a linq query
//load QA names
var qaNames =
from a in db.LUT_Employees
where a.position == "Supervisor" && a.department == "Quality Assurance"
…

Sinaesthetic
- 11,426
- 28
- 107
- 176
2
votes
1 answer
Display members and Value members
Hi I am new to VB platform, Can any one help me to understand the last few lines of code, here I highlight with bold at last, which is not understand or confusing to me. What does that Display member and value number do?
.. cmbcust is the…

Nachiappan R
- 182
- 1
- 1
- 20
2
votes
2 answers
Can't read the value member setting from the data reader to combobox
I'm setting the value member and display member from a datareader to combobox like this.
public void getPartyNamesCombo()
{
SqlDataReader reader = new VotingOP().getPartyNamesToCombo();
while (reader.Read())
{
…

ChathurawinD
- 756
- 1
- 13
- 35
2
votes
1 answer
C#: How to bind to ListBox DisplayMember and ValueMember result from class method?
I'm trying to create ListBox where I will have key-value pair. Those data I got from class which provides them from getters.
Class:
public class myClass
{
private int key;
private string value;
public myClass() { }
public int…

Andebaran
- 35
- 1
- 1
- 5
2
votes
2 answers
How to remove values from valuemember in combobox?
The following code updates populates the combobox cmbBox1.
OracleDataAdapter oraAdapter = new OracleDataAdapter(oraCmd);
DataSet oraDataSet = new DataSet();
oraAdapter.Fill(oraDataSet);
cmbBox1.ValueMember =…

user1100941
- 101
- 1
- 11
1
vote
1 answer
Display ValueMember of DataGridViewComboBoxCell on Combobox Changing Event VB.NET
I'm using this code:
Dim cListItems As New System.Collections.Generic.List(Of Combobox_values)
cListItems.Add(New Combobox_values("One", "1"))
cListItems.Add(New Combobox_values("Two", "2"))
Dim dgvcbc As…

John Nuñez
- 1,780
- 13
- 35
- 51
1
vote
1 answer
pointer NSURL data member
If I put an NSURL in a class declaration and set it to something in a method, when the method finishes the object it's pointing to is gone. Is there a way to have a non pointer version of an object in the declaration like you can in C++? XCode…

Dollarslice
- 9,917
- 22
- 59
- 87
1
vote
1 answer
ComboBox DisplayMember, ValueMember, and DataSource Method
I am working on a c# winforms program that has three comboboxes, each combobox has a different displaymember, valuemember, and datasource. I would like to try to create a method in which I can use to set the member values and datasource that works…

Csumner
- 27
- 5
1
vote
1 answer
System.ArgumentException when trying to use DataGridViewComboBox and ValueMember
ModelLinkControl modelLinkControl = new ModelLinkControl();
modelLinkControl.bindingSourceCModels.DataSource = cModels;
modelLinkControl.bindingSourceAModels.DataSource = aModels;
modelLinkControl.bindingSourceModelLinks.DataSource =…

EursPravus
- 323
- 2
- 8
1
vote
1 answer
How can I save the correct ValueMember of a ComboBox to the entities/db?
How can I save the correct ValueMember of a ComboBox to the entities/db?
My Winform has ComboBoxes that take Values from Entities of a Lookup Data tabel, as in the following code:
private void FillComboBoxes()
{
…

HES
- 21
- 5
1
vote
2 answers
C# Checking string data in combobox displaymember
Here is:
Datatable dt;
......
.......
cmbName.DataSource=dt;
cmbName.ValueMember="ID";
cmbName.DisplayMember="Name";
private void cmbName_Validating(object sender, CancelEventArgs e)
{
if (cmbName.Text == string.Empty)
{
…

Darpan Dahal
- 45
- 8
1
vote
1 answer
Programmatically select an item in combobox by using its ValueMember property
I have a method that gets the ComboBox object and the query to be loaded on its items.
The method also asks for 2 other items:
1.The DB table's column name and sets it into the Combobox's DisplayMember property
2.The id of each record under that DB…

Harambe Attack Helicopter
- 762
- 3
- 18
- 44
1
vote
2 answers
How can I verify the Dictionary values I've assigned to a combobox are what I think they are?
I've got this code to assign a Dictionary to a combobox:
Dictionary dict = ReportRunnerConstsAndUtils.GetReportGeneratorsDictionary();
comboBoxReportRunners.DataSource = new BindingSource(dict,…

B. Clay Shannon-B. Crow Raven
- 8,547
- 144
- 472
- 862