Hi Lynn,
I have re-checked it and yes, I was able to repro it. After debugging, I
found executing the following statement in Edit method makes the ComboBox
displays the first item.
this.ColumnComboBox.Visible = true;
Now, I have re-ordered the statement and put that statement before
assigning ColumnComboBox.SelectedIndex. Use the following as
DataGridComboBoxColumn.Edit method is a workaround to this issue.
protected override void Edit(System.Windows.Forms.CurrencyManager source,
int rowNum, System.Drawing.Rectangle bounds, bool readOnly, string
instantText, bool cellIsVisible)
{
base.Edit(source,rowNum, bounds, readOnly, instantText , cellIsVisible);
_rowNum = rowNum;
_source = source;
this.ColumnComboBox.Visible = true;
ColumnComboBox.Parent = this.TextBox.Parent;
ColumnComboBox.Location = this.TextBox.Location;
ColumnComboBox.Size = new Size(this.TextBox.Size.Width,
ColumnComboBox.Size.Height);
ColumnComboBox.SelectedIndex =
ColumnComboBox.FindStringExact(this.TextBox.Text);
ColumnComboBox.Text = this.TextBox.Text;
this.TextBox.Visible = false;
this.DataGridTableStyle.DataGrid.Scroll += new EventHandler(HandleScroll);
ColumnComboBox.BringToFront();
ColumnComboBox.Focus();
}
HTH.
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."