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

[Solved] Showing denormalised data in RadGrid with Ria Services

2 Answers 84 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
David
Top achievements
Rank 1
David asked on 15 Sep 2010, 03:01 AM
My solution is a standard RIA services application

RadGrid
DomainDataSource
DataContext
LinqToSql DBML
DB

I have tables that have a foreign key, and i'd like to show the name value in the column rather than the id, AND be able to filter on it.
The easiest way to explain it would be

Orders Table
Id
Quantity
Total cost
CustomerId

Customer Table
Id
CustomerName


In my grid I am using the DomainDataContext to automatically pull the data through. So my grid currently looks like this
Id | Quantity | Total cost | CustomerId
And I am using the example on how to do server side filtering. By adding filters to the DomainDataService, I am able to automatically do server side filtering on Total cost and quantity. (e.g. where quantity > 10)

but I would like my grid to to have the name value rather than the Id e.g.
Id | Quantity | Total cost | CustomerName

And I will be required to do filtering on CustomerName (e.g. where CustomerName contains "Smith").


How should I go about this? Will the structure of the DBML be a factor?
Should it be a DBML with 2 tables in it
Orders -> CustomerDetails

or a DBML with a single 'table' in it, with the extra properties and I tell the select query on the domain services side to denormalise / populate those fields

e.g. The "new order" table in the DBML
Id
Quantity
Total cost
CustomerId
CustomerName

2 Answers, 1 is accepted

Sort by
0
David
Top achievements
Rank 1
answered on 17 Sep 2010, 01:27 AM
0
Accepted
Maya
Telerik team
answered on 17 Sep 2010, 11:31 AM
Hello David,

You may find this blog post also helpful and interesting.
 

Best wishes,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
David
Top achievements
Rank 1
Answers by
David
Top achievements
Rank 1
Maya
Telerik team
Share this question
or