Hi,
I have a tough time dealing with Infragistics xamPivotGird. I have classes say Customer and Address.
public class Customer
{
string Name {get; set;}
Address CustAddress {get; set;}
}
public Address
string Street{get; set;}
string State {get; set;}
string City {get; set;}
string ZipCode {get; set;}
In some cases, when my Address is null. while creating Hierarchy, using the below code, I don't see the Hierarchy being built or show up when expanded
var hierarchy = new HierarchyDescriptor<Customer>(p => p.CustAddress );
hierarchy.AddLevel(p => "All Addresses", "All Addresses");
hierarchy.AddLevel(p => p.CustAddress.ZipCode?? "", "ZipCode");
Please guide me here.....Its kind of urgent.
Hi Rajib,
The expression is evaluated when you expand the "All Addresses" hierarchy. If the address is null then that code is going to fail with a NullReferenceException. You should see the NullReferenceException in your Visual Studio output window. Please change your expression to handle the null value. Something like this perhaps:
hierarchy.AddLevel(p => (p.CustAddress == null) ? "" : p.CustAddress.ZipCode, "ZipCode");
I have a class Customer. How can I expose the property(Amount) of Order as a measure, if I create a Cube out of List of Customers(basically FlatDataSource).
Order CustOrder {get; set;}
public Order
string OrderNum {get; set;}
double Amount {get; set;}