Solved

Datagrid column to display description instead of ID.

Posted on 2004-08-12
2
157 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…

735 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