Hi,
We are heavy users of the GridView control. We have run into binding errors, however, when using UniqueName and DataMemberBinding. In our grids, we bind all columns using DataMemberBinding, but we use UniqueName on some columns that are NOT for binding and instead have a custom cell template defined (e.g. place buttons in the cell). The UniqueName is used for this column so we can toggle its visibility when the user exports the grid to Excel. In this case, the code gets a reference to the grid, gets the column to disable by the UniqueName and then turns the visibility to off. After the export, it turns the visibility on.
Here's a snippet:
This all works fine, but the output window can have hundreds and hundreds of binding errors (one for each row in the grid!!) which hurts performance. If we remove the UniqueName it goes away, but then we can't toggle the columns on/off.
A previous post on this topic in the Silverlight forums dates from 2011 and mentions UniqueName being deprecated yet in the latest DLL it is still very much present and useful. Is there any solution for this situation? For now, we are finding the column to toggle using the header but this makes localization extremely challenging.
Steve
We are heavy users of the GridView control. We have run into binding errors, however, when using UniqueName and DataMemberBinding. In our grids, we bind all columns using DataMemberBinding, but we use UniqueName on some columns that are NOT for binding and instead have a custom cell template defined (e.g. place buttons in the cell). The UniqueName is used for this column so we can toggle its visibility when the user exports the grid to Excel. In this case, the code gets a reference to the grid, gets the column to disable by the UniqueName and then turns the visibility to off. After the export, it turns the visibility on.
Here's a snippet:
System.Windows.Data Error: 40 : BindingExpression path error: 'ActionColumn' property not found on 'object' ''CommunicationLogAcco_4549BD8698DC45DB0CECE67D05EB3039BC10A8BFF12C4F445B3229782B933388' (HashCode=36213804)'. BindingExpression:Path=ActionColumn; DataItem='CommunicationLogAcco_4549BD8698DC45DB0CECE67D05EB3039BC10A8BFF12C4F445B3229782B933388' (HashCode=36213804); target element is 'GridViewCell' (Name=''); target property is 'ValueChangedListener' (type 'Object')<
br
>System.Windows.Data Error: 40 : BindingExpression path error: 'ActionColumn' property not found on 'object' ''CommunicationLogAcco_4549BD8698DC45DB0CECE67D05EB3039BC10A8BFF12C4F445B3229782B933388' (HashCode=36213804)'. BindingExpression:Path=ActionColumn; DataItem='CommunicationLogAcco_4549BD8698DC45DB0CECE67D05EB3039BC10A8BFF12C4F445B3229782B933388' (HashCode=36213804); target element is 'ValueSetter' (Name=''); target property is 'Value' (type 'Object')
This all works fine, but the output window can have hundreds and hundreds of binding errors (one for each row in the grid!!) which hurts performance. If we remove the UniqueName it goes away, but then we can't toggle the columns on/off.
A previous post on this topic in the Silverlight forums dates from 2011 and mentions UniqueName being deprecated yet in the latest DLL it is still very much present and useful. Is there any solution for this situation? For now, we are finding the column to toggle using the header but this makes localization extremely challenging.
Steve