How to bind a datagrid to a List property of the model
after searching still can't make work :(
my datasource model machinestatusmodel looks this:
public class drivedata
{
[key]
public char drive { get; set; }
public long freespacemb { get; set; }
public string drivemachinename { get; set; }
}
public class machinestatusmodel
{
[key]
public string machinename { get; set; }
[include]
[association("machinestatusmodel_drivedata", "machinename", "drivemachinename")]
public list<drivedata> drivedatalist { get; set; }
...
}
so machinestatusmodel holds list of drivedata
now use machinestatusdomainservice , using debugger can see data gets transferred fine , values in drivedatalist there on silverlight clientside.
but can't figure out how bind datagrid list :( tried example:
<sdk:datagrid autogeneratecolumns="false" itemssource="{binding elementname=machinestatusmodeldomaindatasource, path=data}" ...>
<sdk:datagrid.columns>
<sdk:datagridtextcolumn x:name="drivenamecolumn" binding="{binding path=machinename, mode=oneway}" ... />
<sdk:datagridtextcolumn x:name="freespacemb" binding="{binding path=drivedatalist.freespacemb, mode=oneway}" ... />
</sdk:datagrid.columns>
</sdk:datagrid>
i can see value in first column, second column empty !
how can bind columns elements of drivedatalist items ??
thanks !
micha
hi mikagenic,
ria service doesn't support lazy loading, need eager loading, please refer thread.
http://betaforums.silverlight.net/forums/p/205148/481014.aspx
thanks,
Silverlight > Programming Silverlight with .NET – General
Comments
Post a Comment