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
1305
xamPivotDataSelector and the values that are displayed from a bound source
posted

Hi Guys,

We are loading the PivotDataSelector datasource via Linq To SQL, no issues here. The problem we have is that we would like to display a column name with spaces so that is looks better for reporting purposes ie 'ThisIsSomeValue' with 'This Is Some Value'

Below is the code I've taken from the WPF samples app:

private void GetData()
{
  Type objectType = Type.GetType("POCServices.Data." + reportTypeComboEditor.Value.ToString() + ", POCServices");
  IEnumerable newInstance = (IEnumerable)Activator.CreateInstance(objectType); // This will create an instance of Opportunity class

  GetData(newInstance);
}

private void GetData<T>(T sourceObject) where T : IEnumerable
{
  FlatDataSource dataSource = new FlatDataSource();
  dataSource.ItemsSource = sourceObject;

  POCServices.Interface.IView currentSource = (POCServices.Interface.IView)sourceObject;
  currentSource.GetHierarchies(dataSource);

  this.pivotGrid.DataSource = dataSource;
  this.pivotDataSelector.DataSource = dataSource;
}

public class Opportunity : ObservableCollection<zzOpportunities>
{

public Opportunity()
{
  List<zzOpportunities> opportunities = GetAll();
  foreach (zzOpportunities opp in opportunities)
  {
     this.Add(opp);
  }
}

public static List<zzOpportunities> GetAll()
{
  EMDBDataContext dc = new EMDBDataContext();
  return dc.GetTable<zzOpportunities>().ToList<zzOpportunities>();
}

}

As I mentioned earlier the above code works well, but how would I go about customizing what is shown in the PivotDataSelector after the control is bound to my datasource?

Any help would be very much appreciated.

Cheers,

Marty. 

Parents Reply Children
No Data