5 Answers, 1 is accepted
0

Dr
Top achievements
Rank 1
answered on 07 Nov 2013, 03:27 PM
Is this possible? It would really help me out if someone could provide a sample of how to accomplish this. Thanks again.
0
Hello,
You can refer to the following sample and use Templates provided by RadPivotGrid in order to achieve the desired functionality:
http://demos.telerik.com/aspnet-ajax/pivotgrid/examples/templates/defaultcs.aspx
Hope this helps.
Regards,
Eyup
Telerik
You can refer to the following sample and use Templates provided by RadPivotGrid in order to achieve the desired functionality:
http://demos.telerik.com/aspnet-ajax/pivotgrid/examples/templates/defaultcs.aspx
Hope this helps.
Regards,
Eyup
Telerik
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 the blog feed now.
0

Barbaros Saglamtimur
Top achievements
Rank 1
answered on 11 Nov 2013, 11:20 AM
Here is how I use;
celltemplate.ascx
celltemplate.ascx.cs
<
telerik:PivotGridRowField
DataField
=
"ItemGroup"
UniqueName
=
"ItemGroup"
ZoneIndex
=
"1"
>
<
CellTemplate
>
<
uc1:celltemplate
ID
=
"celltemplate1"
runat
=
"server"
/>
</
CellTemplate
>
</
telerik:PivotGridRowField
>
celltemplate.ascx
<
asp:HyperLink
ID
=
"HyperLink1"
runat
=
"server"
NavigateUrl
=
"#"
Text="<%#GetCellText() %>"></
asp:HyperLink
>
celltemplate.ascx.cs
private
PivotGridRowHeaderCell _container;
public
PivotGridRowHeaderCell Container
{
get
{
return
_container ?? (_container = Parent
as
PivotGridRowHeaderCell); }
}
protected
string
GetCellText()
{
//Actually there is a javascript string returning here
return
Container.DataItem.ToString();
}
0

Dr
Top achievements
Rank 1
answered on 13 Dec 2013, 06:55 PM
Very helpful, Thank You!
Another question though. If I wanted to use data from another table as the HyperLink value instead of "#", how would I accomplish this?
The table I'm using in the DataField of the PivotGridRow is "Title", which are the names of Video Titles. But I want the HyperLink to be the Alias of the Title, which is a different Table.
Title: Iron Qon Raid Video
Alias: iron-qon-raid-video
Another question though. If I wanted to use data from another table as the HyperLink value instead of "#", how would I accomplish this?
The table I'm using in the DataField of the PivotGridRow is "Title", which are the names of Video Titles. But I want the HyperLink to be the Alias of the Title, which is a different Table.
Title: Iron Qon Raid Video
Alias: iron-qon-raid-video
0
Hello,
Please note that RadPivotGrid uses compressed data from the source ,therefore, accessing and manipulating DataItem info is not straightforward as it is with RadGrid:
http://www.telerik.com/help/aspnet-ajax/grid-accessing-cells-and-rows.html
In this sense, I'm afraid it is not possible to pass multiple Field values into the Cell template. You will need to make a call to the database or manually set the NavigateURL of the HyperLinks:
I hope the clarification was helpful.
Regards,
Eyup
Telerik
Please note that RadPivotGrid uses compressed data from the source ,therefore, accessing and manipulating DataItem info is not straightforward as it is with RadGrid:
http://www.telerik.com/help/aspnet-ajax/grid-accessing-cells-and-rows.html
In this sense, I'm afraid it is not possible to pass multiple Field values into the Cell template. You will need to make a call to the database or manually set the NavigateURL of the HyperLinks:
protected
void
RadPivotGrid1_CellDataBound(
object
sender, PivotGridCellDataBoundEventArgs e)
{
if
(e.Cell.Field !=
null
&& e.Cell.Field.UniqueName ==
"ShipName"
)
{
PivotGridRowHeaderCell cell = e.Cell
as
PivotGridRowHeaderCell;
HyperLink link = cell.FindControl(
"HyperLink1"
)
as
HyperLink;
string
url =
"http://wikipedia.org/wiki/"
+ cell.DataItem.ToString().Replace(
" "
,
"-"
);
link.NavigateUrl = url.ToLowerInvariant();
}
}
I hope the clarification was helpful.
Regards,
Eyup
Telerik
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 the blog feed now.