Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to bind objects list to infragistics data grid?
    primarykey
    data
    text
    <p>Pretty simple task, but the source code doesn't do required job... Please advise.</p> <p>There is Products collection in the class (approach is based on the MVVm pattern, but that is not influe on the current issue):</p> <pre><code>public class ProductWindowViewModel : WorkspaceViewModel // implements INotifyPropertyChanged { public ProductWindowViewModel() { Products = new List&lt;Product&gt;(ProductService.Instance.Repository.GetAll()); } List&lt;Product&gt; Products { get; set; } } </code></pre> <p>Here is class declaration:</p> <pre><code>public class Product : IEntity { #region Public Properties public int Id { get; set; } public string Name { get; set; } public string Description { get; set; } public int Cost { get; set; } #endregion } </code></pre> <p>The class instance is binded to the window's Grid data context:</p> <pre><code>ProductWindow wnd = new ProductWindow(); wnd.MainGrid.DataContext = new ProductWindowViewModel(); wnd.ShowDialog(); </code></pre> <p>And here is xaml code of the window:</p> <pre><code>&lt;Window x:Class="WpfTest1.ProductWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="ProductWindow" Height="300" Width="300" xmlns:igDP="http://infragistics.com/DataPresenter" xmlns:ViewModel="clr-namespace:ViewModel;assembly=ViewModel"&gt; &lt;Grid x:Name="MainGrid"&gt; &lt;Grid.Resources&gt; &lt;ObjectDataProvider x:Key="odpObjectDataProvider" ObjectType="{x:Type ViewModel:ProductWindowViewModel}" /&gt; &lt;/Grid.Resources&gt; &lt;Grid DataContext="{StaticResource odpObjectDataProvider}"&gt; &lt;igDP:XamDataGrid DataSource="{Binding Path=Products}"/&gt; &lt;/Grid&gt; &lt;/Grid&gt; </code></pre> <p></p> <p>The xamDataGrid sampe is the same. overall code is pretty simple, but doesn't work.</p> <p>Does anybody know why? Any thoughts are welcome.</p> <p>How could I debug binding to resolve the problem himselft?</p> <p>Thanks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload