public string GetDisplayText(int index) { // Validate the index. if ((index < 0) && (index >= base.Items.Count)) throw new IndexOutOfRangeException("Invalid index."); // Get the text. string text = string.Empty; int memIndex = -1; try { base.BeginUpdate(); memIndex = base.SelectedIndex; base.SelectedIndex = index; text = base.SelectedItem.ToString(); base.SelectedIndex = memIndex; } catch { } finally { base.EndUpdate(); } return text; }
} // Commit protected override object GetColumnValueAtRow(System.Windows.Forms.CurrencyManager source, int rowNum) { // Return the display text associated with the data, insted of the // data from the DataGrid datasource. return combobox.GetDisplayText(base.GetColumnValueAtRow(source, rowNum)); } // GetColumnValueAtRow