c# - Binding Gridview by Eval in Linq -


I have a LINQ expression that joins two tables. I want to add the 'list' to the gridwish. DataBinding: Code GridView creates this error in the template 'SearchResult' does not include a property with the name 'codereq'

  IQueryable & LT; SearchResult & gt; MyList = TBL_Apartment in T.Code at TBL_Owner joining the K == equals == k.Code where k.CodeReq t.CodeReq is new SearchResult {codereq = t.CodeReq, name = t.Name} Public class SearchResult {Public string codereq selection; The name of the public string; }   

Bind gridview code:

  grid search. Data source = myList.ToList (); GridSearch.DataBind (); As the grid view for   

is as below your aspx page:

   & Lt; Client settings & gt; & Lt; AllowRowSelect = "True" /> & Lt; / ClientSettings & gt; Selecting & lt; / Telerik: RadGrid>    

it should help

  code  MyCodeReq = 1; (Or some other type of variable) list & lt; SearchResult & gt; MyList = (TBL_Apartment T is equal to joining K in TBL_Owner t.Code at k.Code where k.CodeReq == myCodeReq select new SearchResult {codereq = t.CodeReq, name = t.Name}) ToList ( ) .; Grid search Data source = myList; GridSearch.DataBind ();    

Comments