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
70
XamGrid Databinding
posted

*edited for clarity*
I am having issues trying to databind to a XamDataGrid. I am using the mvvmcross framework, however the binding model should be pretty similar.

My sample ViewModel has a collection of Student objects. I am able to bind that ViewModel to a ListView using the following syntax:

ListView ItemsSource="{x:Bind Vm.Students}" 

This however doesn't seem to work for the XamDataGrid. I did try:

ig:XamDataGrid x:Name="Grid1" AutoGenerateColumns="True" SelectionMode="SingleRow"  RowHeight="75" ItemsSource="{x:Bind Vm.Students}"

I also did try the alt syntax that uses a CollectionViewSource:

ItemsSource="{Binding Source={StaticResource RecordingsCollection} }

Sample Code attached for reference. Any ideas on what might be the issue?

IGXamGrid.zip
Parents
No Data
Reply
  • 5170
    Offline posted

    What do you mean by it's not working?  Are you getting an exception, or binding errors, or nothing is showing?  I downloaded your sample, switch to using the NuGet packages, and everything worked fine for me using the x:Bind syntax.  I did remove the StackPanel because the layout was bad, but I didn't change anything else.

Children