DataGridViewComboBoxColumn displays ValueMember instead of DisplayMember

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I have search all the othe Message and do not see the answer ............
in a datagridview I went through the property settings and created the following :<img alt="" src="http://social.msdn.microsoft.com/Forums/getfile/147537
DisplayMember ITCombo appears as the program runs but when the Selecting has been made and Edit mode ends it turns in the ValueMemeber ItemID.
Here id the code:
<pre style="background:white; color:black; font-family:Consolas <span style="color:blue #region Assembly Tab DatagridView w/ Combobox Selection
<span style="color:blue private <span style="color:blue void combo4_SelectionChangeCommitted(<span style="color:#2b91af Object sender, <span style="color:#2b91af EventArgs e)
{
<span style="color:#2b91af ComboBox cmbbox4 = sender <span style="color:blue as <span style="color:#2b91af ComboBox;

<span style="color:blue if (cmbbox4.Text != <span style="color:blue null)
{
<span style="color:blue string sAssemblyName = <span style="color:#a31515 "";
sAssemblyName = cmbbox4.Text;

<span style="color:blue var r = <span style="color:blue new <span style="color:#2b91af Regex(<span style="color:#a31515 @"s");
<span style="color:blue var Name = r.Split(sAssemblyName);
sAssemblyName = Name[0];
cmbbox4.Text = sAssemblyName;
Refresh();
sAssemblyStream = <span style="color:#a31515 "";
sAssemblyStream = cmbbox4.SelectedValue.ToString();
<span style="color:blue if (sAssemblyStream == <span style="color:#a31515 "")
{
<span style="color:blue return;
}

<span style="color:#2b91af DataRow[] drASSEMBLYSTREAM;
drASSEMBLYSTREAM = quoteDevDataSet.ItemMaster.Select(<span style="color:#a31515 "ItemID =" + sAssemblyStream + <span style="color:#a31515 "");
iRow = assemblyDataGridView.CurrentRow.Index;

<span style="color:#2b91af ProcessForASSEMBLYSTREAM processAssemblyStream = <span style="color:blue new <span style="color:#2b91af ProcessForASSEMBLYSTREAM();
processAssemblyStream.ProcessAssemblyStream(drASSEMBLYSTREAM, assemblyDataGridView, sAssemblyName, iRow);

sFormTypes = <span style="color:#a31515 "qty2";

<span style="color:blue if (!<span style="color:blue string.IsNullOrEmpty(sFormTypes))
{
DisplayInputFormType(sFormTypes);
}
<span style="color:blue this.Refresh();

assemblyDataGridView[<span style="color:#a31515 "dataGridViewTextBoxColumn15", iRow].Value = quoteIDTextBox.Text; <span style="color:green //quoteID

assemblyDataGridView.EndEdit();
assemblyDataGridView.Update();
assemblyDataGridView.Refresh();

}<span style="color:green //End If (cmbbox != null)
}<span style="color:green //Fills the Assembly DGV with the Selected Assembly Information[/code]
I do not know why but when you repeat the step for the second time the ITCombo Number stays !!!!!!!!
I think this may be a glitch with C#. By the way this is VS2010. ANY HELP IS GREALY APPRECIATED !!!!!!!!!!!!



View the full article
 
Back
Top