PC Review


Reply
Thread Tools Rate Thread

Current record of datatable in dataset

 
 
Paul Aspinall
Guest
Posts: n/a
 
      24th Jan 2005
Hi
I have a datatable which I have linked to a combo control, via the
datasource property of the combo control.

I have also set the displaymember property of the combo, to ensure that my
description is shown in the combo.

However, I want to have another value of the same row of the datatable (as
selected in the combo), displayed in a text box. ie. so that when I change
the value in the combo, a text box displays a value from another field in
the same datarow.

Can anyone offer any tips, or code samples?

Thanks


 
Reply With Quote
 
 
 
 
Ranjan
Guest
Posts: n/a
 
      24th Jan 2005
Best way is to Bind the text box also to the DataTable, and use
BindingContext to update the textbox when the combo is updated (best
solution)

You might also use a ValueMember property of the combobox, and set the
textbox's text property using this value member (like a primary key) in the
Combo's changed event.
Ranjan

--
http://dotnetjunkies.com/weblog/dotnut




"Paul Aspinall" <(E-Mail Removed)> wrote in message
news:wq4Jd.210234$(E-Mail Removed)...
> Hi
> I have a datatable which I have linked to a combo control, via the
> datasource property of the combo control.
>
> I have also set the displaymember property of the combo, to ensure that my
> description is shown in the combo.
>
> However, I want to have another value of the same row of the datatable (as
> selected in the combo), displayed in a text box. ie. so that when I change
> the value in the combo, a text box displays a value from another field in
> the same datarow.
>
> Can anyone offer any tips, or code samples?
>
> Thanks
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
newbie: Getting the latest record in a DataTable in DataSet ??? Jeff Microsoft C# .NET 3 7th Jan 2008 02:09 PM
Current record of datatable in dataset Paul Aspinall Microsoft Dot NET Framework Forms 1 24th Jan 2005 11:14 AM
Current record of datatable in dataset Paul Aspinall Microsoft C# .NET 1 24th Jan 2005 11:14 AM
Creating a DataSet and DataTable then adding a record. Help! David Hearn Microsoft ADO .NET 2 3rd Jun 2004 01:40 PM
dataset relation current record MajorTom Microsoft C# .NET 0 4th May 2004 08:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:49 AM.