Hello,
I have attached a sample that displays a problem a full project I have been working on is exhibiting. I'm using an attached property behavior to set custom field layouts. It gets applied... but only to the second and subsequent items. It does not apply to the first item!
If I change "LabelLocation" to "InCell", all of them display the correct for that style, but this is not desired behavior for the full program (where there's about 20 fields with sub-layouts as well).
I'm also placing this grid inside a XamTabControl and getting an exception of "FieldLayout can not be moved to another DataPresenterBase." when it hits "target.FieldLayouts.Add( layout );" but I think I need instead to bind to FieldLayoutInitializing in there, so that is a problem I can investigate myself for now.
I look forward to any assistance you might be able to provide, thank you!
I am attaching a screenshot with the latest service relase for 11.1 build 11.1.20111.2053. What version and build are you using?
Thanks,
Diyan Dimitrov
Here is a screenshot of the behavior. This happens in both design mode and in runtime.
Yes, that would help me understand the issue.
I should probably elaborate a little more; I apologize for the shortness of my last reply!
The field layouts are generated programmatically - this is due to some extreme complexity and variety in the data that gets displayed in a reusable datagrid user control. The fields are applied via the Attached Behavior pattern, which I decided to go with after finding another post elsewhere on the forums suggesting that. It seems to work; save two flaws. The one that I'm asking about here is that it appears as though the field layouts are not applied to the first item. (So grid record 1) But they ARE applied to grid records 2, 3, 4, and so on.
I can provide a screenshot if necessary; but when the sample is loaded into VS2010 SP1 designer for me it even displays on the grid preview page. Would you like me to attach a screenshot of the grid displaying the first record not having the field layout applied?
In the sample the field layout isn't being applied to the first record; but it is being applied to all subsequent records. I hope that clears it up.