Re: DataGridView with ComboBox column - Pre-select a value.
- From: "Andy" <andy.and.suzanne.cooper@xxxxxxxxx>
- Date: 14 Nov 2006 03:08:04 -0800
Hi Robin,
Many thanks for the suggestion.
The SelectedIndex property for a ComboBox in a DataGridView column does
not exist.
Cheers,
Andy
RobinS wrote:
Set the SelectedIndex to the one you want displayed.
Robin S.
"Andy" <andy.and.suzanne.cooper@xxxxxxxxx> wrote in message
news:1163165414.892529.324170@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
I have a simple form with a DataGridView which contains a ComboBox
column. The ComboBox is successfully filled at run time from a
DataTable. The DataTable contains about 6 text values which are
displayed as a drop-down list
//Fill the combobox with the different methods of IP
connection.
this.colConnection_Method.DataSource =
DataTableIPConnectionMethods;
//Display the method names ...
this.colConnection_Method.DisplayMember =
"Method_Name";
// ... but store the selected method's primary key
value.
this.colConnection_Method.ValueMember = "Method_PK";
My question is how can I pre-select one of the ComboBox values?
I'm using VS 2005 C# on Windows XP.
Many thanks in advance,
Andy
.
- Follow-Ups:
- References:
- Prev by Date: IO.Compression and Encryption Error
- Next by Date: Re: DataGridView with ComboBox column - Pre-select a value.
- Previous by thread: Re: DataGridView with ComboBox column - Pre-select a value.
- Next by thread: Re: DataGridView with ComboBox column - Pre-select a value.
- Index(es):
Relevant Pages
|