I have a GridView which contains a template column with a custom control which loads a variable number of images from the web site. The images initally load correctly, but disappear when you scroll.
The HealthIndicatorControl contains a stack panel to which images are dynamically loaded and added into the panel. I am manually binding the HealthIndicatorControl is the RowLoaded event and setting a property on the HealthIndicatorControl.
Any ideas?
------- Row Loaded event handler
-- Grid Column XAML
The HealthIndicatorControl contains a stack panel to which images are dynamically loaded and added into the panel. I am manually binding the HealthIndicatorControl is the RowLoaded event and setting a property on the HealthIndicatorControl.
Any ideas?
------- Row Loaded event handler
void grdSites_RowLoaded(object sender, RowLoadedEventArgs e) |
{ |
if (e.Row.Cells != null) |
{ |
if (e.Row.Cells.Count >= STATIC_COLUMN_COUNT) |
{ |
GridViewCellBase cellBase = e.Row.Cells[STATIC_COLUMN_COUNT - 1]; |
IList<HealthIndicatorControl> childItems = cellBase.ChildrenOfType<HealthIndicatorControl>(); |
if (childItems.Count > 0) |
{ |
HealthIndicatorControl control = childItems[0]; |
e.Row.DataContext).JobSiteDTO.HealthIndicators; |
} |
} |
} |
} |
-- Grid Column XAML
<grid:GridViewDataColumn Header="Health" IsReadOnly="True" IsFilterable="False" IsSortable="False"> |
<grid:GridViewDataColumn.CellTemplate> |
<DataTemplate> |
<controls:HealthIndicatorControl HealthIndicatorData="{Binding HealthIndicators}"></controls:HealthIndicatorControl> |
</DataTemplate> |
</grid:GridViewDataColumn.CellTemplate> |
</grid:GridViewDataColumn> |