Product Bundles
DevCraft
All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
Web
Mobile
Document Management
Desktop
Reporting
Testing & Mocking
CMS
UI/UX Tools
Debugging
Free Tools
Support and Learning
Productivity and Design Tools
public
partial
class
Form1 : Form
{
Form1()
InitializeComponent();
List<DataObject> data =
new
List<DataObject>();
Random rand =
Random();
for
(
int
i = 0; i < 500; i++)
data.Add(
DataObject() {Date = DateTime.Today.AddDays(i), Value = rand.NextDouble() * 1000.0d});
}
this
.radPivotGrid1.AggregateDescriptions.Add(
PropertyAggregateDescription() { PropertyName =
"Value"
});
.radPivotGrid1.RowGroupDescriptions.Add(
WeekGroupDescription() { PropertyName =
"Date"
.radPivotGrid1.DataSource = data;
DataObject
DateTime Date {
get
;
set
; }
double
Value {
WeekGroupDescription : PropertyGroupDescriptionBase
WeekGroupName : IComparable
weekNumber;
WeekGroupName(
weekNumber)
.weekNumber = weekNumber;
override
string
ToString()
return
"Week "
+ weekNumber;
CompareTo(
object
obj)
if
(obj
is
WeekGroupName)
weekNumber.CompareTo(((WeekGroupName)obj).weekNumber);
1;
bool
Equals(
weekNumber.Equals(((WeekGroupName)obj).weekNumber);
false
GetHashCode()
weekNumber.GetHashCode();
protected
GroupNameFromItem(
item,
level)
DataObject data = item
as
DataObject;
(data !=
null
)
WeekGroupName(System.Globalization.DateTimeFormatInfo.CurrentInfo.Calendar.GetWeekOfYear(data.Date,
System.Globalization.CalendarWeekRule.FirstDay,
System.Globalization.DateTimeFormatInfo.CurrentInfo.FirstDayOfWeek));
Cloneable CreateInstanceCore()
WeekGroupDescription();