I have this grid
<igWPF:XamDataGrid DataSource="{Binding Path=aktiveUgeaviserMedAlles, Mode=OneWayToSource}" HorizontalAlignment="Left" Grid.Row="8" VerticalAlignment="Top" Height="365" Width="1537" Grid.ColumnSpan="13" Grid.RowSpan="3" Name="dgMediePlanlinjer" Margin="46,28,0,0" GroupByAreaLocation="AboveDataArea" BindToSampleData="True"> <igWPF:XamDataGrid.FieldLayouts> <igWPF:FieldLayout> <igWPF:FieldLayout.Settings> <igWPF:FieldLayoutSettings AutoArrangeCells="Never" AutoGenerateFields="true" /> </igWPF:FieldLayout.Settings> </igWPF:FieldLayout> </igWPF:XamDataGrid.FieldLayouts>
</igWPF:XamDataGrid>
and this method to fill in the data
public void setAviserTilGrid(int bladid) { var res = aviserDao.GetAllUgeAvisTilGrid(bladid, System.DateTime.Now.Year-1, 1); aktiveUgeaviserMeds.Add(res); aktiveUgeaviserMedAlles = new System.Collections.ObjectModel.ObservableCollection<List<AviserTilGrid>>(); aktiveUgeaviserMedAlles.Add(aktiveUgeaviserMeds);
dgMediePlanlinjer.DataSource = aktiveUgeaviserMedAlles ; // MessageBox.Show("Hej August"); }
I can see that there are data in aktiveUgeaviserMedAlles but no data in the Grid
Hello Thomas,
Thank you for contacting Infragistics. From your code, I see you are also setting BindToSampleData="True" and in code behind your setting the datasource to aktiveUgeaviserMedAlles. Try removing the xaml binding and sample data. From there are you getting any errors in the output window when binding in code behind? Please try and provide a sample demonstrating the behavior. Only then will I be able to provide a better answer for you. Thanks.
I forgot this the object in the List that is passed to xamdatagrid
#region Assembly dlu-persistence-api, Version=2.0.9.22, Culture=neutral, PublicKeyToken=null// C:\Users\Thomas Kleist\source\repos\DLUPersistence-service-api\dlu-persistence-api\bin\Release\dlu-persistence-api.dll#endregion
using System.Collections.Generic;
namespace dlu_persistence_api.daos{ public class AviserTilGrid { public AviserTilGrid();
public string OrdredeadlineTekst { get; set; } public string OrdreDeadlineRubrikKl { get; set; } public byte? OrdreDeadlineRubrikDag { get; set; } public string OrdredeadlineRubrik { get; set; } public byte? OrdrecheckSendeDagID { get; set; } public string OrdrecheckEmail { get; set; } public int Oplag { get; set; } public byte? OrdreDeadlineTekstDag { get; set; } public bool Ophoert { get; set; } public string Navn { get; set; } public decimal? MMPris { get; set; } public decimal? mmPris { get; set; } public byte? MedlemMaaned { get; set; } public byte? Medlemaar { get; set; } public byte MaxDaekningsGrad { get; set; } public string MaterialeEmail { get; set; } public string Navn2 { get; set; } public string OrdreDeadlineTekstKl { get; set; } public string OrdreEmail { get; set; } public string OrienteringEmails { get; set; } public bool VisPaaWWW { get; set; } public byte? TotalomraadePct { get; set; } public int? Totalomraade { get; set; } public string Tlf { get; set; } public string StamdataEmail { get; set; } public bool? SendIndevaerendeUge { get; set; } public string SendetidOrdrecheck { get; set; } public string SamannonceringsRabat { get; set; } public string RegionNavn { get; set; } public string RedaktionEmail { get; set; } public string PrislisteNavn { get; set; } public string PrisforespoergselEmails { get; set; } public byte? PrimaerPct { get; set; } public int? Primaer { get; set; } public int? PostNr { get; set; } public string PostBy { get; set; } public bool Overfoert { get; set; } public string MaterialeDeadlineTekstKl { get; set; } public byte? MaterialeDeadlineTekstDag { get; set; } public string MaterialedeadlineTekst { get; set; } public string MaterialeDeadlineRubrikKl { get; set; } public decimal? Farve4Min { get; set; } public decimal? Farve4Max { get; set; } public int FakturaGruppeID { get; set; } public string Emails { get; set; } public string Ejerforhold { get; set; } public string DiMPDelOmraadeKode { get; set; } public string DagNavn { get; set; } public int DaekningsGrad { get; set; } public string BogholderiEmails { get; set; } public string BilagsbladeEmail { get; set; } public string Betegnelse { get; set; } public string AnnonceKontrolEmail { get; set; } public string Adresse2 { get; set; } public string CVR { get; set; } public int BladID { get; set; } public string AnnonceEmail { get; set; } public string Adresse { get; set; } public decimal? Farve4Pris { get; set; } public string WWWDaekningSomTekst { get; set; } public decimal? FarveMax { get; set; } public decimal? FarvePris { get; set; } public byte? MatGodtBeloeb { get; set; } public byte? MaterialeDeadlineRubrikDag { get; set; } public string MaterialedeadlineRubrik { get; set; } public bool? MaaGiveFarveRabat { get; set; } public string KontaktpersonerEmails { get; set; } public string Kontaktperson { get; set; } public string Koncern { get; set; } public int Husstande { get; set; } public string HovedGruppeNavn { get; set; } public string Hjemmeside { get; set; } public string GruppeRabat { get; set; } public bool GiverWebTillaeg { get; set; } public string GeoKodeNavn { get; set; } public int FormatTil { get; set; } public int FormatFra { get; set; } public string Format { get; set; } public string Fax { get; set; } public decimal? FarveMin { get; set; } public List<webtilLæg> webtillages { get; set; } }}
I put together a sample project to get started on reproducing the behavior. But since there are missing components from your code above I can't continue. I'll need your help finishing up the sample. Please see below. Thanks.
WpfApp12.zip
Hi Michael
I found the solution and it was not where I was looking
Great! Let us know if you have any additional questions or concerns.