I have two controls in a GridViewDataColumn (LinkButton and Texblock) and only one control is visible at a time.
<Controls:GridViewDataColumn DataMemberBinding="{Binding Id, Mode=OneWay}" Header="{x:Static lr:TransactionHistoryRes.Id_Header_Text}" UniqueName="TransactionHistoryModelId" Width="130"> <Controls:GridViewDataColumn.CellTemplate> <DataTemplate> <Grid> <max:LinkButton HorizontalAlignment="Right" Command="{Binding DataContext.OpenDocumentCommand, RelativeSource={RelativeSource FindAncestor, AncestorType=Views:TransactionHistoryView}}" CommandParameter="{Binding Path=.}" Content="{Binding Path=Id}" Visibility="{Binding Path=CanCreateOrViewDocument, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}"> </max:LinkButton> <TextBlock HorizontalAlignment="Right" Text="{Binding Path=Id}" ToolTip="{Binding Path=Information}" Visibility="{Binding Path=CanCreateOrViewDocument, Converter={StaticResource ReverseBooleanToVisibilityCollapsedConverter}}"/> </Grid> </DataTemplate> </Controls:GridViewDataColumn.CellTemplate> </Controls:GridViewDataColumn>
When the grid initially load, it works fine.
However, there's a wierd behavior that if you SORT the column, initially - the LinkButtons wont show even if it's visibility = true
When you try to sort the column again, the LinkButtons are shown "gradually". (see video link below)
https://youtu.be/GI5G-WaPy-k
When I tried to remove the <Texblock> and just retain the LinkButton, its not behaving like this so I think its something about putting two controls in the cell template. I tried separating the two controls by stackpanel but sill the same behaviour.
Thanks,
Karlo