Hi,
I am quite in Infragistics and I would need some help to style the first column in Tree Grid. I am not sure how to create a style for the first column without breaking the functionality of tree behavior. I need to combine two first columns (Left and Type) into single one. The image column it should be before the text value left.
Simply moving the image column into first position breaks all tree functionality. This would be also an option if tree functionality would remain with images in the first column.
I've added sample project which I am trying out this functionality.
Or xaml code:
thanks for help in advance.
Tomas
Hello Tomas,
Thank you for the sample application and code-snippet you have provided.
In order to successfully display the child data and the expansion indicator in the XamTreeGrid when the first field (column) contains an image, I can suggest you set the ContentTemplate property of the CellValuePresenters for the image field instead of the Template property.By setting the Template property, the entire cell gets retemplated and its by-design functionality will not function properly, along with the issue of not displaying the expansion indicators.
XAML:
<Setter Property="ContentTemplate"> <Setter.Value> <DataTemplate > <Grid Width="{Binding Width}" Height="{Binding Height}" DataContext="{Binding RelativeSource={RelativeSource AncestorType=igDP:TreeCellValuePresenter}}"> <Image Margin="{Binding Padding}" HorizontalAlignment="{Binding HorizontalContentAlignment}" VerticalAlignment="{Binding VerticalContentAlignment}" MaxHeight="16" MaxWidth="16" Source="{Binding Path=Content, Converter={StaticResource ElementTypeToIconConverter}}"/> </Grid> </DataTemplate> </Setter.Value></Setter>
I have attached a sample application that demonstrates the approach from above.
If you have any questions, please let me know.