473,324 Members | 2,581 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Current record of datatable in dataset

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
Nov 16 '05 #1
1 2728
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" <pa**@aspy.co.uk> wrote in message
news:wq*******************@fe2.news.blueyonder.co. uk...
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

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Steve | last post by:
Visual Studio 2003 .Net / C# I have a datagrid, which is bound to a dataset at runtime when my page loads. When the user double clicks a row, I need to find out which row they have selected so...
0
by: Patrick | last post by:
I'm working on a contact management application, and need a hand with one aspect... Here's what I want to create: ------------------------------------ A form split into two parts. There is a...
3
by: Christopher Weaver | last post by:
I want to set a value in a specific field in the current row of a DataSet. This seems like the most basic thing to do but I can't find the syntax for identifying the current row. IOW, I can do...
2
by: Mark Perona | last post by:
I created an ASP.net form with an editable datagrid on it. I can create new records, and update and delete existing records. The problem I have is that I want a field in the grid to be editible...
0
by: Ben | last post by:
module main ... application.run(new splashform) .. end module after a few screen, I try to load a new codes I got from MSDN on datagrid that works on its own. I took out submain and ran...
4
by: DaBrain | last post by:
Win32 C++/Delphi Developer here moving to .NET C# (Yes, I'm a newbie again) Thank you all for any replies in advance. I am developing a class that accesses a record, one record, and sets the...
1
by: Marko | last post by:
I am trying to add new record in database. There is no compile error but program is not adding any record to database. Hot to fix it? This is my code: OleDbDataAdapter odbAdapt; DataSet...
1
by: Ivan Sammut | last post by:
I have an asp webpage on which I have a dropdownlist which I fill from my database using Datasets. Now I want to add an empty record in the dataset so the first option of the list is empty but I...
3
by: msnews.microsoft.com | last post by:
Greetings I have a a simple application with 1 form. On my form I use a BindingSource to bind a database table to a "table (gridDataView)" (one in the database, one on my form, 2 different...
1
by: Barfy the Wonder Camel | last post by:
I've loaded a dataset from an access database, and now I want to find a specific record in a datatable that's part of that dataset. First, I was surprised to find that the Find() method complains...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.