Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
155
Is there a way to hide Half Year and Quarter from date dimension in xamPivotGrid
posted

Hi,

Is there a way to hide Half Year(H1, H2) and Quarter(Q1, Q2, etc) from date dimension in xamPivotGrid? We only want to show year, month, and day info for a date type dimension.

Thanks,

Joseph

 

 

Parents
No Data
Reply
  • 7922
    posted

    Hi

    You should create your own HierarchyDescriptor and exclude the levels that you dont want to be visible. Below is a snipet

     HierarchyDescriptor dateTimeDescriptor = new HierarchyDescriptor { AppliesToPropertiesOfType = typeof(DateTime) };
     dateTimeDescriptor.AddLevel<DateTime>(dt => SR.GetString("AllPeriods"), "All Periods");
     dateTimeDescriptor.AddLevel<DateTime>(dt => dt.Year, "Years");
     dateTimeDescriptor.AddLevel<DateTime>(dt => dt.SemesterShort(), "Semesters");
     dateTimeDescriptor.AddLevel<DateTime>(dt => dt.QuarterShort(), "Quarters");
     dateTimeDescriptor.AddLevel<DateTime>(dt => dt.MonthShort(), "Months");
    pivotGrid.DataSource.HierarchyDescriptors.Add(dateTimeDescriptor);
    

    Regards
    Todor

Children