This is a migrated thread and some comments may be shown as answers.

Joint datatables in grid

1 Answer 16 Views
Grid
This is a migrated thread and some comments may be shown as answers.
rtk
Top achievements
Rank 1
rtk asked on 07 Nov 2008, 01:31 PM
I have a master table called contacts. One field is contact_type_id. In the master table I would like to display the contact_type_name which resides in the contact_type table. So rather than just displaying the contact_type_id which is in the master contacts table, I would like to show the name of the contact type to be more explicit.

I know i could join the two tables in sql and get everything in one datatable, but my business objects does not allow that. Is there a way to join these 2 datatables in the grid, or do i have to do this on itembound??


1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 10 Nov 2008, 10:35 AM
Hello brajoh,

One possible approach in this case would be to populate the grid control via the NeedDataSource event handler. In this case, you can query the underlying database, and populate a dataTable, which can be passed to the grid control. This way, you will have a chance to make the table in a custom way, corresponding to the logic behind a possible join.

Greetings,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
rtk
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or