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
45
Simple xamPivotGrid
posted

I am trying to make a simple example with xamPivotGrid, but am not able to make it work.

The code uses a List, since the documentation states thatxamPivotGrid works with Lists.

	List<testData> testList = new List<testData>();
	testList.Add(new testData(1, 1, 1));
	testList.Add(new testData(2, 2, 2));
	testList.Add(new testData(3, 3, 3));
 
	FlatDataSource flatDataSource = new FlatDataSource();
	flatDataSource.ItemsSource = testList;
	flatDataSource.Cube = DataSourceBase.GenerateInitialCube("TestCube");
	flatDataSource.Columns = DataSourceBase.GenerateInitialItems("[TimeID]");
	flatDataSource.Rows = DataSourceBase.GenerateInitialItems("[AreaID]");
	flatDataSource.Measures = DataSourceBase.GenerateInitialItems("[Measure]");
	xamPivotGrid1.DataSource = flatDataSource;
 
}
public class testData
{
	public int AreaID;
	public int TimeID;
	public float Measure;
	public testData(int AID, int TID, float Meas)
	{
		AreaID = AID;
		TimeID = TID;
		Measure = Meas;
	}
}
Parents Reply Children