I would like my ComboBox to display the 'CustomerName'
value but it should store the 'CustomerID' value whenever
it is assigned to the DataTable.LoadDataRow. Also, I need
to trap the 'CustomerID'value in the
ComboBox_SelectedIndexChanged Event whenever that event is
fired.
Thanks!

Re: ComboBox Values! by Miha

Miha
Fri Dec 19 03:37:30 CST 2003

Hi Lora,

Assign 'CustomerName' to DisplayMember and 'CustomerID' to ValueMember.
You can retrieve the id by using SelectedValue property.

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

"Lora Connors" <lora_con@yahoo.com> wrote in message
news:067001c3c60d$6514c3c0$a601280a@phx.gbl...
> I would like my ComboBox to display the 'CustomerName'
> value but it should store the 'CustomerID' value whenever
> it is assigned to the DataTable.LoadDataRow. Also, I need
> to trap the 'CustomerID'value in the
> ComboBox_SelectedIndexChanged Event whenever that event is
> fired.
> Thanks!
>



Re: ComboBox Values! by Lora

Lora
Fri Dec 19 07:00:16 CST 2003

I am aware of the properties. But could you help me with
the syntaxes?
Thanks!


>-----Original Message-----
>Hi Lora,
>
>Assign 'CustomerName' to DisplayMember and 'CustomerID'
to ValueMember.
>You can retrieve the id by using SelectedValue property.
>
>--
>Miha Markic - RightHand .NET consulting & software
development
>miha at rthand com
>www.rthand.com
>
>"Lora Connors" <lora_con@yahoo.com> wrote in message
>news:067001c3c60d$6514c3c0$a601280a@phx.gbl...
>> I would like my ComboBox to display the 'CustomerName'
>> value but it should store the 'CustomerID' value
whenever
>> it is assigned to the DataTable.LoadDataRow. Also, I
need
>> to trap the 'CustomerID'value in the
>> ComboBox_SelectedIndexChanged Event whenever that event
is
>> fired.
>> Thanks!
>>
>
>
>.
>

Re: ComboBox Values! by Miha

Miha
Fri Dec 19 07:17:46 CST 2003

Hi Lora,

comboBox1.DataSource = dataTable1; // table holding customer

comboBox1.DisplayMember = "CustomerName";

comboBox1.ValueMember = "CustomerId";

Does this help?


--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

"Lora connors" <lora_con@yahoo.com> wrote in message
news:03ca01c3c630$0c6b14e0$a001280a@phx.gbl...
> I am aware of the properties. But could you help me with
> the syntaxes?
> Thanks!
>
>
> >-----Original Message-----
> >Hi Lora,
> >
> >Assign 'CustomerName' to DisplayMember and 'CustomerID'
> to ValueMember.
> >You can retrieve the id by using SelectedValue property.
> >
> >--
> >Miha Markic - RightHand .NET consulting & software
> development
> >miha at rthand com
> >www.rthand.com
> >
> >"Lora Connors" <lora_con@yahoo.com> wrote in message
> >news:067001c3c60d$6514c3c0$a601280a@phx.gbl...
> >> I would like my ComboBox to display the 'CustomerName'
> >> value but it should store the 'CustomerID' value
> whenever
> >> it is assigned to the DataTable.LoadDataRow. Also, I
> need
> >> to trap the 'CustomerID'value in the
> >> ComboBox_SelectedIndexChanged Event whenever that event
> is
> >> fired.
> >> Thanks!
> >>
> >
> >
> >.
> >