Access RadPivotGrid Row and Column value for corresponding Data Cell.

2 posts, 0 answers
  1. ts
    ts avatar
    13 posts
    Member since:
    Aug 2014

    Posted 17 Aug 2014 Link to this post

    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());
        }
  2. Radoslav
    Admin
    Radoslav avatar
    1564 posts

    Posted 18 Aug 2014 Link to this post

    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.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top