Hi,
XamDataGrid - version 19.2
There is a tab control that hosts a xamdatagrid with a lot of columns. Based on the tab in selection the related grid columns are made visible while setting visibility to false on the rest. This happens on the tab switching event. What is observed (see pic.) is that on switching from tab 3 to tab 1 the 2nd column 1st row has the correct contenttemplate and shows data while the 2nd row has an incorrect contenttemplate and so doesnt show the data. Note that the parent element's data context is not being propogated to the child. The child belongs to another column.
I was able to "workaround" this, strangely, by changing the order of the columns but we need to get to the cause.
Thanks
Reshma
Hi Andrew,
Thanks for looking into this. I've incorrectly submitted here, this is used on a WPF app
1. InfragisticsWPF.Controls.Grids.XamGrid.dll 19.02.20192.52
2. There is 1 grid that is being used by all tabs. In the XAML there is a tab control followed by the grid. The UI shows the impression of hosting the grid on the tab but its actually just 1 grid being reused by all tabs. Each tab is to show a certain set of columns on selection and hide the rest. The columns are bound to the grid using the datasource property. On the tab selection event the columns for the tab are made visible and rest are collapsed
3. Yes the template is applied once for the 2 rows and is correctly set at the start. Switching between the tabs is causing the behavior where the cell content disappears. Only the visibility is being changed on the event
4. We are setting the ContentTemplate on the CellValuePresenter as a xaml style.
<Style x:Key="LeggerStyleCellTemplate" TargetType="{x:Type dataPresenter:CellValuePresenter}"
<Setter Property="ContentTemplate"> <Setter.Value> <DataTemplate>
<Grid x:Name="Grid" Height="21">
<ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="Center" Visibility="{TemplateBinding Visibility}"/>
Hello Reshma,
Thank you for confirming that you are using WPF and also using version 19.2.20192.52. I have a couple of further questions from your response. Can you please answer the following?
1. I am a little bit confused on where your grid is in this case. It sounds like from point 2 that your grid doesn’t actually “belong” to any of the tabs in your tab control, but rather that it is parented by the same parent element as the tab control and then acted upon when a new tab is selected. Can you please confirm this?
2. Have you tried using the TemplateField object in this case, as this is the recommended way to template the contents of the CellValuePresenter. I am curious if this behavior happens for you if you use the TemplateField. You can read about usage of the TemplateField here: https://www.infragistics.com/help/wpf/xamdatagrid-configuring-template-field.
3. Being that you are using the base version of Infragistics for WPF 2019.2, I would be curious to know if this issue happens with the most recent (and final) service release as well. I would recommend downloading version 19.2.20192.357 from your account on the website and testing against that, as there have been 4 patches to version 2019.2 since version 19.2.20192.52.
Please let me know if you have any other questions or concerns on this matter.