Declined
Last Updated: 20 Oct 2016 12:12 by ADMIN
Combinations
Created on: 01 Sep 2016 06:34
Category: GridView
Type: Bug Report
1
GetCellContent is not used when bound to nested property
I have a custom column based on GridViewBoundColumnBase. In it I override GetCellContent. If I bind the column to a nested property (MyProperty.SubProperty), what I return in GetCellContent is not shown, instead the nested property's "raw" value is shown.

Attached is a project illustrating the issue.
Attached Files:
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
1 comment
ADMIN
Martin
Posted on: 20 Oct 2016 12:05
We did some research and found that this is by-design implementation. The reported behavior is due to the fact, that for a nested property binding the GetCellContent method is not used. It is used for performance optimizations so that the value of the TextBlock is retrieved directly. In case there is a nested property, the built-in Binding mechanism provided by the framework is used. The only option that may be offered for such customizations is to override the CreateCellElement method, instead of overriding the GetCellContent one, and return a TextBlock with its Text property set to be the hard-coded value. You can also inherit GridViewColumn instead of GridViewBoundColumnBase since it will not use the binding of the column.