Hi,
my grid displays - for example - organization units: OrgUnit objects. The OrgUnit class has a property "Manager" which contains an instance of the class "Person". This class has, in turn, a property named "FullName".
I want to display names of managers in one of the grid's columns. I bind this column with: "Manager.FullName". And it works perfectly - event for units with no manager.
Then, I want to sort my grid by this column. I put SortExpression="Manager.FullName". It works - but fails (NullReferenceException) when any of displayed units has no manager.
I understand that "Manager.FullName" can raise this exception when "Manager" is null but when displaying data it doesn't.
Can I solve this problem any way?
The workaround: define a special property "ManagerFullName" (return Manager == null ? "" : Manager.FullName) is not acceptable.
Regrads
Tomasz
my grid displays - for example - organization units: OrgUnit objects. The OrgUnit class has a property "Manager" which contains an instance of the class "Person". This class has, in turn, a property named "FullName".
I want to display names of managers in one of the grid's columns. I bind this column with: "Manager.FullName". And it works perfectly - event for units with no manager.
Then, I want to sort my grid by this column. I put SortExpression="Manager.FullName". It works - but fails (NullReferenceException) when any of displayed units has no manager.
I understand that "Manager.FullName" can raise this exception when "Manager" is null but when displaying data it doesn't.
Can I solve this problem any way?
The workaround: define a special property "ManagerFullName" (return Manager == null ? "" : Manager.FullName) is not acceptable.
Regrads
Tomasz