J
jay
I have a structure:
public struct DATA_PAIR
{
public int ID;
public string Value;
public DATA_PAIR(int id, string val)
{
this.ID = id;
this.Value = val;
}
}
I have a combo box and I'm adding items:
....
ArrayList locations = new ArrayList();
locations.Add(new ORCASettings.Common.DATA_PAIR(0, ""));
while (Reader.Read())
{
locations.Add(new ORCASettings.Common.DATA_PAIR((int)Reader[0],
Reader[9].ToString()));
}
cboLocation.ValueMember = "ID" ;
cboLocation.DisplayMember = "Value";
cboLocation.DataSource = locations;
....
....but this doesn't work. ValueMember and DisplayMember don't get affected.
What I get in my combo box is Type of the objects: ClassName+DATA_PAIR.
Thanks,
h
public struct DATA_PAIR
{
public int ID;
public string Value;
public DATA_PAIR(int id, string val)
{
this.ID = id;
this.Value = val;
}
}
I have a combo box and I'm adding items:
....
ArrayList locations = new ArrayList();
locations.Add(new ORCASettings.Common.DATA_PAIR(0, ""));
while (Reader.Read())
{
locations.Add(new ORCASettings.Common.DATA_PAIR((int)Reader[0],
Reader[9].ToString()));
}
cboLocation.ValueMember = "ID" ;
cboLocation.DisplayMember = "Value";
cboLocation.DataSource = locations;
....
....but this doesn't work. ValueMember and DisplayMember don't get affected.
What I get in my combo box is Type of the objects: ClassName+DATA_PAIR.
Thanks,
h