AnimatGuiCtrls.Controls.DataGridComboBox.GetDisplayText C# (CSharp) Method

GetDisplayText() public method

public GetDisplayText ( int index ) : string
index int
return string
        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;
        }

Same methods

DataGridComboBox::GetDisplayText ( object value ) : string
DataGridComboBox::GetDisplayText ( ) : string[]

Usage Example

		} // 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