Solved

Datagrid column to display description instead of ID.

Posted on 2004-08-12
2
152 Views
Last Modified: 2010-04-23
Okay, another question from the Newbie.

I have a dataset called dsPOLookup which consists of two tables.
POHEADER and STATUS (they are linked by POHEADER.PO_STATUS and STATUS.STATUS_ID)

I have a dataview dvPOHeader which uses dsPOLookup.POHEADER as its' table.

I have a datagrid which uses dvPOHeader as its' DataSource

When I populate the datagrid, I want the Status column to contain the STATUS_DESC from the status table instead of displaying PO_STATUS from PO_HEADER.
Is this possible? Can a dataview contain more than one table? If so, how? I am using the properties dialog to set these values, perhaps I have to write some code?!

Please let me know if you can help.

THanks and Regards,
Marnie.
0
Comment
Question by:MarnieHook
2 Comments
 
LVL 2

Accepted Solution

by:
waterhidden earned 50 total points
ID: 11781479

of course it is possible. you have to change the commandtext which fills dvPOHeader. if you send the command texts you use, i'll try to help you more specific.



0
 

Author Comment

by:MarnieHook
ID: 11789214
Hi there,
THankyou for your response.

I'm not sure what you mean by the commandText as in the properties of the dataview it only has a property called 'Table'. THis is where I have specified 'DsPOLookup1.POHeader' as the table. I don't think I can specify more than one table or a 'Select query' for that matter.

I just read the online help regarding dataviews and it says you can't have multiple tables for a dataview:

'However, a DataView differs significantly from a database view in that the DataView cannot be treated as a table and cannot provide a view of joined tables. You also cannot exclude columns that exist in the source table, nor can you append columns, such as computational columns, that do not exist in the source table.'

Perhaps I have to retrieve the status_desc as the rows are populated in the table? Is there an event associated with the insertion of each row in the table as it populates? If so, is this a good place to put the lookup to find the Status_desc?

I'll have to investigate further.

Thanks again,
Marnie.


0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video discusses moving either the default database or any database to a new volume.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now