Hi. I can not make my images show in datagrid.
I have the files uploaded as a resource within my Gesuro project and there, in the Images folder.
I follow the steps according to what you indicate in your instructions, but the images are not shown.
The rest of the data does appear correctly.
I have tried with AutoGenerateColumns in both true and false.
My XAML:
<SfDg:SfDataGrid
x:Name="ThirdBasic"
AutoGenerateColumns="False"
ItemsSource="{Binding ResultsTotal}">
<SfDg:SfDataGrid.Columns x:TypeArguments="SfDg:Columns">
<SfDg:GridImageColumn HeaderText="Empresa"
MappingName="ImgSource" />
<SfDg:GridTextColumn HeaderText="Costo"
MappingName="CostTotal" />
</SfDg:SfDataGrid.Columns>
</SfDg:SfDataGrid>
My model:
namespace Gesuro.Models
{
public class CarQuoteResult
{
public CarQuoteResult(string imageStr, double costTotal)
{
ImgSource = ImageSource.FromResource(imageStr);
CostTotal = costTotal;
}
public double CostTotal { get; set; }
public ImageSource ImgSource { get; set; }
}
}
My method in viewmodel (implement INotifyPropertyChanged)
public void LoadResults()
{
ResultsTotal = new ObservableCollection<CarQuoteResult>
{
new CarQuoteResult("Gesuro.Images.QuoteSancor.png", 985),
new CarQuoteResult("Gesuro.Images.QuoteMapfre.png", 628),
};
}
Any help please?
Thanks in advance
Sergio Cossa
Attachment:
Image_of_project_b2ad3352.rar