Hi,
I have one observerblecollection binded to XamDatagrid datasource and with another collection creating fields through code behind.
I am unable to bind the data in CellValuePresenterStyle through code behind.
When I ran the solution, I observed that data is not appering on the xamdatagrid.
Could you please help me to resolve the issue .
I have attached my sample and screen shot of Xamdatagrid.
Thanks in advance,
Regards,
Chandra
Screen shot
Hello Chandra,
I have been looking into your issue and no fields appear in the XamDataGrid because the field(‘Value’) that you are trying to add to the grid does not match none of the name of a property exposed by your data entity. For more information please look into the following link fro mour online documentation :
http://help.infragistics.com/NetAdvantage/WPF/2012.2/CLR4.0/?page=xamDataPresenter_Define_a_Field_Layout.html
Let me know, if you need any further assistance on this matter
Hi Yanko,
Thanks for your quick reply.
I looked into suggested link..In my case ,I am creating the fields in code behind(Ex: Value)
As per documentation, it doesnt match the other data collection.So data is not appearing.
I tried as per your suggestion, still i m not able to see the data.
Could you please provide me suggested changes in my sample.So that i can apply logic.
Waiting for your reply.
--
Hi Chandra,
I am just checking, if you need any further assistance on this matter.
The easiest way to show only some fields in the XamDataGrid is by handling the ‘FieldLayoutInitialized’ event of the XamDataGrid like e.g. :
private void xamGrid_FieldLayoutInitialized(object sender, Infragistics.Windows.DataPresenter.Events.FieldLayoutInitializedEventArgs e)
{
Field productIDField = new Field
Name = "FileName",
Label = "FileName"
};
Field productNameField = new Field
Name = "IsBiggerFile",
Label = "IsBiggerFile"
e.FieldLayout.Fields.Add(productIDField);
e.FieldLayout.Fields.Add(productNameField);
}
Let me know, if you need any further assistance on this matter.