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

Add a Link in Cell Template

2 Answers 146 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Pierre
Top achievements
Rank 1
Pierre asked on 18 Oct 2016, 12:24 PM

Hi,

I have search everywhere.

Documentation( Really poor documentation on  Pivot ) , Knowledge Base ( Last post 2015, the second last 2012 ) , Forum well ..

Is it possible to add a "Real link" in the cell of a PivotGrid.
By real , I mean base on data that are in the result set but are not diplayed. Things like id, number that are never displayed to Customer.

I would like to show some more information based on fields that are in the result set but are not diplayed.
Its to mutch information for a little tooltips.

I need to create a link with "~/Somewhere/MyDetailPage.aspx?P=HiddenRowField&Filter=ColumnField"


As its seems to be impossible to get multiple field value into a cell template.
If I add a button in the cell template. Will I be able to retrieve Row/Column Field Value Of the clicked Button ?

 

2 Answers, 1 is accepted

Sort by
0
Pierre
Top achievements
Rank 1
answered on 19 Oct 2016, 08:01 AM
Rad PivotGrid Can't be a dead end, Customer don't want some information displayed in Pivot Grid for the beauty of it.
I am not sure why we can't access multiple field value that are in the datasource.
Do we really need to check all cell on bound to add a simple link. Connecting to DataBase for every cell trying to get the Id we are looking base on the only data stored in the 'Compressed datasource' aka the result of the aggregation function.
 
So Container.DataItem  Give me 2 .. So what is the seller the product and the shop the date anything ?
Any usefull information that is not here only for display.
Do not get me wrong - I 'm not complaning i am looking for a solution.
this could have been a feature request but i have no time to desgn this for you.
0
Konstantin Dikov
Telerik team
answered on 21 Oct 2016, 07:38 AM
Hi Pierre,

The RadPivotGrid main idea is to summarize reports and display information to the end user and customization beyond that purpose are hard to achieve with that control, due to its complexity. Nevertheless, for this particular requirement you can handle the OnCellDataBound event and use the following code for retrieving the parent columns and rows of the data cells:
PivotGridDataCell dataCell = e.Cell as PivotGridDataCell;
 
if (dataCell != null && dataCell.CellType == PivotGridDataCellType.DataCell)
{
    string rowName = GetName(dataCell.ParentRowIndexes);
    string columnName = GetName(dataCell.ParentColumnIndexes);
    var value = dataCell.DataItem;
    // your custom logic
}

Hope this helps.
 

Regards,
Konstantin Dikov
Telerik by Progress
Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
Tags
PivotGrid
Asked by
Pierre
Top achievements
Rank 1
Answers by
Pierre
Top achievements
Rank 1
Konstantin Dikov
Telerik team
Share this question
or