Sort a collection using linq or lambda expression and assign to collection -


i have sort collection based on sort-order field collection. did following way.

var objresult = err in ibussofterrors.iclbemployererror                             join codvalue in lclbcodevalue                                 on err.severity_id equals codvalue.icdocodevalue.code_id                             orderby codvalue.icdocodevalue.code_value_order                             select ibussofterrors.iclbemployererror; 

ibussofterrors.iclbemployererror collection use in grid. problem when try assign query result collection getting following error.

cannot implicitly convert type 'system.collections.generic.ienumerable<>' 'system.collections.objectmodel.collection<>'. explicit conversion exists (are missing cast?)

help me out collection sorted using lambda or linq.

binding requires ilist implementation so

var objresult = err in ibussofterrors.iclbemployererror                         join codvalue in lclbcodevalue                             on err.severity_id equals codvalue.icdocodevalue.code_id                         orderby codvalue.icdocodevalue.code_value_order                         select err; var tobind = objresult.tolist(); grid.itemssource = tobind; 

should (assuming wpf/silverlight datagrid)


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -