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

Access RadPivotGrid Row and Column value for corresponding Data Cell.

1 Answer 156 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
ts
Top achievements
Rank 1
ts asked on 17 Aug 2014, 05:44 PM
Hi,
 
I am new to .Net programming and trying to impliment RadPivotGrid to develop a report.
 
There is no issue with RadPivotGrid implimentation. But, having difficulties in accessing Row and Column Group values.
 
As shown in Code behind, I am looking for corresponding sic_2_code and effective_year value for selected data cell.
 
<Fields>
                <telerik:PivotGridRowField DataField="sic_2_code" Caption="SIC Group" ZoneIndex="0">
                </telerik:PivotGridRowField>
                <telerik:PivotGridColumnField DataField="effective_year" Caption="Year" ShowGroupsWhenNoData="false">
                </telerik:PivotGridColumnField>
                <telerik:PivotGridAggregateField DataField="Proposed Premium" DataFormatString="{0:$#,##0}">
                    <CellTemplate>
                        <asp:LinkButton ID="LB_ProposedPremium" runat="server" OnClick="LB_ProposedPremium_Click">
            <%# string.Format("{0:$#,##0}", Container.DataItem)%>
                        </asp:LinkButton>
                    </CellTemplate>
                </telerik:PivotGridAggregateField>
</Fields>
 
Code Behind

protected void LB_ProposedPremium_Click(Object sender, EventArgs e)
    {
       
        string sBusinessSegment = string.Join(",", RCB_BusinessSegment.CheckedItems.Select(x => x.Value).ToArray());
     
//I need values of sic_2_code and effective_year to pass to another page
 
string sSICCode =??
string sEffectiveYear =??
 
 
        StringBuilder sb = new StringBuilder();
        sb.Append("NB_YearToYearSales.aspx");
        sb.Append("?SegmentID=" + sBusinessSegment);
sb.Append("&SICCode=" + sSICCode);
sb.Append("&EffectiveYear =" + sEffectiveYear);
        Response.Redirect(sb.ToString());
    }

1 Answer, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 18 Aug 2014, 07:27 AM
Hi,

To achieve the desired functionality you can try using the ParentRowIndexes and ParentColumnIndexes which every data cell had. These indexes are array of objects which are the corresponding row and column cell values. More information you can find here:
http://www.telerik.com/help/aspnet-ajax/pivotgrid-conditional-formatting.html

I hope this helps.

Regards,
Radoslav
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
PivotGrid
Asked by
ts
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Share this question
or