Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Datagrid column to display description instead of ID.

Posted on 2004-08-12
2
Medium Priority
?
165 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 100 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
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 …
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

916 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