Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
460
No data in xamdatagrid
posted

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

Parents
  • 28925
    Offline posted

    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. 

Reply Children