Hi
I've implemented data virtualization technique from http://bea.stollnitz.com/blog/?p=411 sucessfully however binding the actual data in the datagrid is giving me problems. The actual data is wrapped in a data wrapper exposed as the Data property which i've tried binding in the DataGrid field but it doesn't work.
So far i've done:
Codebehind:
myDataGrid.DataContext = new AsyncVirtualizingCollection<Partner>(partnerProvider, 100, 5000);
xaml:
<igDP:XamDataGrid x:Name="myDataGrid" DataSource="{Binding}"> <igDP:XamDataGrid.FieldLayouts> <igDP:FieldLayout> <igDP:FieldLayout.Fields> <igDP:Field Name="{Binding Data.Name1}"/> </igDP:FieldLayout.Fields> </igDP:FieldLayout> </igDP:XamDataGrid.FieldLayouts></igDP:XamDataGrid>
What am i doing wrong?
Hello,
From the code snippet that you have provided, you are defining the layout incorrectly. The Name of the field cannot be bound. It must match the name of the name of a public property from the data source.
You can see more information on how to Define Layouts Manually and how to use Unbound Fields if you need to bind to a complex property. FieldLayout overview you can find here.
Thanks for the repsonse. I've got it working.
I've got another question regarding binding complex properties, when i bind for ex. Customer.FullName.ID, how can i get the object of the ID property (which is FullName)?
To the best of my knowledge there is no direct way of doing this with unbound fields. You may want to submit a feature request for this here.
Hi mheusser/Infragistics gurus,
I am also planning to Data virtualization but my problem is that I have grouping as well in my xamDataGrid and my data also keeps on growing (meaning that data from DB keeps growing and it should be reflected in UI also).
What would be the besst approach to update UI with Live data and also have data virtualization.
Any ideas whould be much appreciated!
Thanks,
Imad.
Hi Infragistics gurus!
I am sure you people would have come across handling data virtualization or paging with XamDataGrid with grouping.
I am really looking for a solution badly. Will be grateful for your timely help.
Hi,Will you please share how were you able to bind Data.Name1 property in your code/xaml?
I am also trying to port my existing WPF DataGrid with XamDataGrid. I have the same data virtualization implemented like yours.
Awaiting your response.
Thank You.
Hello Rajiv,
Here it is explained how the FieldLayouts are created and how you can define them:
http://www.infragistics.com/community/blogs/petar_monov/archive/2011/05/13/how-to-define-fieldlayouts-how-fieldlyouts-are-mapped.aspx
Hope this helps you.