This is the ContentTemplate for my XamDataGrid Field. No matter what I do, the cell height will not expand to accommodate the TextBlock. Please help. thanks
<Style x:Key="CellValuePresenterStyle" TargetType="{x:Type igDP:CellValuePresenter}">
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<TextBlock Text="{Binding Comment}" DataContext="{Binding DataContext.DataItem, RelativeSource={RelativeSource AncestorType={x:Type igDP:CellValuePresenter}}}" TextWrapping="Wrap">
</TextBlock>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
Hello Guan,
Thank you for your post.
I have been looking into the sample application that you have provided. The assemblies used in it are for 12.2. I have tested the sample with the latest service release for 12.2 and I could not reproduce the issue, it seems that your sample works fine on my side. I attached a screenshot with the result. Can you provide me with the exact version, that you are using(volume and service release)?
Please let me know if there are some specific steps, that I can follow, in order to reproduce the issue.
Looking forward to hearing from you.
It seems that you uncomment the line TextWrapping property of the TextEditorStyle. The cell will size to the height of the build-in text editor just fine.
My problem is the third column which has a ContentTemplate. The cell will not size to the height of the TextBlock within the content template when it is wrapped.
Thanks
I have further researching your issue and the sample application that you have provided. It seems that the reason for it is because you are using ContentTemplate instead of Template. In order to achieve your requirement without using style for XamTextEditor, you should change the ContentTamplate with Template and DataTemplate with ControlTemplate.
Please let me know if you need any further assistance on this matter.
I would rather avoid the CtontrolTemplate if I could, because I will loose some built in cell functionalities. Is there a way to get this to work in the ContentTemplate instead?
I have been looking into it and it seems that I am missing something from your scenario. Would you please provide me with more detailed information what is the issue when you use the style for the XamTextEditor. Also would you please provide with more detailed description of your requirements in order to be able to investigate your issue.