Hi!
Below is an exact example of my Xaml file with
<igTiles:XamTilesControl.ItemTemplateMaximized > <DataTemplate x:Name="Maximus"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="1*" ></ColumnDefinition> <ColumnDefinition Width="1*" ></ColumnDefinition> </Grid.ColumnDefinitions> <Grid Grid.Column="0" Grid.Row="0" > <Image Margin="10" Source="{Binding PlikPodgladu}" VerticalAlignment="Center" HorizontalAlignment="Center" /> </Grid> <Grid Grid.Column="1" Grid.Row="0" > <StackPanel> <Label Content="Produkt:"></Label> <TextBlock Text="{Binding Produkt}" Foreground="Black" FontSize="14" FontWeight="Bold"></TextBlock> <Label Content="Nakład:"></Label> <TextBlock Text="{Binding Naklad}" Foreground="Black" FontSize="14" FontWeight="Bold"></TextBlock> <Label Content="Termin realizacji:"></Label> <TextBlock Text="{Binding TerminRealizacji, StringFormat={}{0:dd-MM-yyyy}}" Background="{Binding TerminRealizacji, Converter={StaticResource TermConverter}}"></TextBlock> <Label Content="Papiery:"></Label> <TextBlock Text="{Binding Papier}" Foreground="Black" FontSize="14" FontWeight="Bold"></TextBlock> <Label Content="Kolorystyka:"></Label> <TextBlock Text="{Binding Kolorystyka}" Foreground="Black" FontSize="14" FontWeight="Bold"></TextBlock> <Label Content="Uszlachetnianie:"></Label> <TextBlock Text="{Binding Uszlachetnianie}" Foreground="Black" FontSize="14" FontWeight="Bold"></TextBlock> <Label Content="Uwagi:"></Label> <TextBlock Text="{Binding uwagiNaklejka}" Foreground="Red" FontSize="14" FontWeight="Bold"></TextBlock> </StackPanel> </Grid> <Grid Grid.Column="0" Grid.Row="1"> <igDP:XamDataGrid HorizontalAlignment="Stretch" Name="KomentarzeDG" AutoFit="True" VerticalAlignment="Stretch" Background="Cornsilk" Theme="Office2k7Blue" GroupByAreaMode="DefaultFieldLayoutOnly"> <igDP:XamDataGrid.GroupByArea> <igDP:GroupByArea Visibility="Hidden" IsEnabled="False" /> </igDP:XamDataGrid.GroupByArea> <igDP:XamDataGrid.FieldSettings> <igDP:FieldSettings AllowResize="True" AllowEdit="False" AllowRecordFiltering="True" FilterClearButtonVisibility="Visible" /> </igDP:XamDataGrid.FieldSettings> </igDP:XamDataGrid> </Grid> <Grid Grid.Column="1" Grid.Row="1"> <igDP:XamDataGrid HorizontalAlignment="Stretch" Name="UwagiDG" AutoFit="True" VerticalAlignment="Stretch" Background="Cornsilk" Theme="Office2k7Blue" GroupByAreaMode="DefaultFieldLayoutOnly"> <igDP:XamDataGrid.GroupByArea> <igDP:GroupByArea Visibility="Hidden" /> </igDP:XamDataGrid.GroupByArea> <igDP:XamDataGrid.FieldSettings> <igDP:FieldSettings AllowResize="True" AllowEdit="False" AllowRecordFiltering="True" FilterClearButtonVisibility="Visible" Width="Auto" /> </igDP:XamDataGrid.FieldSettings> </igDP:XamDataGrid> </Grid> </Grid> </DataTemplate> </igTiles:XamTilesControl.ItemTemplateMaximized>
So, inside of my XamTilesControl I have a ItemTemplateMaximized with DataTemplate and inside of it is XamDataGrid. I need to bind some dynamically changed data (I set TileStateChanging event) but I can't find reference to these objects.
Any help will be welcome.
Thanks
Hi Krasimir!
I think Your solution will be enough for now.
Thanks for answers.
Hello Daniel,
After further research on your issue it turns out that the data sources of XamDataGrids cannot be set in TilesStateChanging event handler. This is because the grids are initialized after the TilesStateChanging and TilesStateChanged events are fired.
I still think that you best option seems to be implementing two properties for the data sources of the two XamDataGrids and bind those properties in the data template.
Please let me know if you require any further assistance on the matter.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics, Inc.
www.infragistics.com/support
Your solution seems to work fine, but it's very close to my own.
I was rather looking for a way to find element in pseudo-DOM structure of XAML file. This would be similar to typicall .NET Repeater control solution Item.FindControl (from RepeaterItemEventArgs). I tried to use FindName, but without success.
Anyway if there's no such possibilty to achieve it in this way, thanks for suggestions.
Best regards
Daniel
I am just checking the progress on your issue.
Please let me know if this is what you needed and if you require any further assistance on the matter.
I have investigated your issue and I think that your best option seems to be creating two properties in your viewmodel class which will represent the data source of XamDataGrids that initially will be set to null. You can set the data binding in XAML and in TilesStateChanging event handler you can set the values to those properties.