This is a migrated thread and some comments may be shown as answers.
Display multiple row values into single cell (LINQ and RadGrid)
4 Answers 123 Views
This is a migrated thread and some comments may be shown as answers.
Brian Flaherty
Top achievements
Rank 1
Brian Flaherty asked on 14 Jun 2010, 10:30 PM
Below is a scaled down version for what I am needing.

Table A has two columns:  Location_ Name,  ITEM_ID
Table B has two columns:  ID,    Description

Relationship is 1 to many, respectively.

In my grid I want to concatenate all descriptions delimited by ',' and by each location into a single cell.

The output would be as follows:

Location                                         Description

Westchester                12546,145879,15698,12583
Torrance                     32145,3258,32458
Glendale                      14785
Pasadena                    14589,156478


Grid properties:

AutoGenerateColumns

 

 

="False"
AllowFilteringByColumn="True"

 

 

 

AllowPaging="True"
AllowSorting="True"


Please advise how I can achieve this?

Thanks in advance.

 

4 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 18 Jun 2010, 08:30 AM
Hi Brian,

The following example demonstrates how to nest additional information in a template column:

http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/columntypes/defaultcs.aspx

You can concatenate the two tables either dynamically from the code behind, into one table, or via the select statement of the datasource control, by joining them.
I hope this information gets you started properly.

Best wishes,
Yavor
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
0
Mark
Top achievements
Rank 1
answered on 17 Jan 2013, 12:30 AM
Link no longer works
: (
0
Pavlina
Telerik team
answered on 18 Jan 2013, 09:43 AM
Hi Mark,

The demo link opens as expected. Can you try opening it again and see if you still encounter the same problem?

Kind regards,
Pavlina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Chandan
Top achievements
Rank 1
answered on 27 Sep 2015, 08:06 AM

You can try this:

 <telerik:GridCalculatedColumn

DataFields="QUESTION,OPT_1,OPT_2,OPT_3,OPT_4"

FilterControlAltText="Filter QUESTION column"

HeaderText="Question & Options"

Expression='"<strong>Question:</strong> " + {0} + "<br/><br/> <strong>Option 1: </strong>" +  {1} + "<br/> <strong>Option 2:</strong> " + {2} + "<br/> <strong>Option 3:</strong> " + {3} + "<br/> <strong>Option 4:</strong> " + {4} + "<br/>" '

UniqueName="QUESTION">
                                          
</telerik:GridCalculatedColumn>​

Tags
Grid
Asked by
Brian Flaherty
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Mark
Top achievements
Rank 1
Pavlina
Telerik team
Chandan
Top achievements
Rank 1
Share this question
or