I have an object exposing an ImageSource public property. These objects are in a collection that implements the IEnumerable interface.
Through procedural code, I am able to bind the collection to my XamDataGrid using the latter's DataSource property.
All data is displayed in the grid apart from the images representing each object within the collection. My XAML setup for the grid is presented below;
<igDP:XamDataGrid Name="dataGrid" Grid.Row="1" ScrollingMode="Immediate" SortRecordsByDataType="False" IsGroupByAreaExpanded="True" > <igDP:XamDataGrid.FieldLayoutSettings> <igDP:FieldLayoutSettings AllowAddNew="False" AllowDelete="False" HighlightAlternateRecords="True"/> </igDP:XamDataGrid.FieldLayoutSettings> <igDP:XamDataGrid.FieldSettings> <igDP:FieldSettings CellClickAction="SelectRecord" LabelClickAction="SortByOneFieldOnly" AllowEdit="False" AllowGroupBy="True"/> </igDP:XamDataGrid.FieldSettings> </igDP:XamDataGrid>
My question is how do I get the Image property for each object displayed in the grid?
TIA.
What was your solution?
Solution was easier that I thought.
Items in my observable collection have a public property called 'StatusImage' of type System.Object. During runtime, each item is constructed with an instance of System.Windows.Controls.Image that represents StatusImage.
This is all that has been done so far to display an image within each record within code.
In XAML, the field to display the record's image is defined normally like so:
<igDP:Field Name="StatusImage" Label="Status"/>
Without having to define a CellValuePresenter, an image is displayed in the Status field of each record.