Hi all,
I m trying to fill my radgrid's datasource by using linq to sql. Till now i successfully done it when i used only one table in queries. But when i wanted to join two tables i failed. Here is the method i used for data binding.
It is compiled and at run time i get this error : DenemeClass' is not a valid metadata type for type filtering operations. Type filtering is only valid on entity types and complex types.
It may not be related with radgrid but i guess you good people could help me. Thanks.
I m trying to fill my radgrid's datasource by using linq to sql. Till now i successfully done it when i used only one table in queries. But when i wanted to join two tables i failed. Here is the method i used for data binding.
public
RadGridSurveyAnswerPointsModel ViewSurveyAnswerPoints(
int
startIndex,
int
maximumRows,
string
sortExpressions,
string
filterExpressions)
{
RadGridSurveyAnswerPointsModel model =
new
RadGridSurveyAnswerPointsModel();
IQueryable q = (from x
in
Context.cc_SurveyPoint
join y
in
Context.CC_SurveyPointMain on x.SurveyMainPointID equals y.ID
orderby x.Code
select
new
DenemeClass
{
Id = x.ID,
Code = x.Code,
Description = x.Description,
Sequence = x.Sequence,
isActive = x.ISActive,
IconId = x.IconId,
Point = x.Point,
SurveyMainPointId = y.Code
});
GridLinqBindingData data = RadGrid.GetBindingData(q, startIndex, maximumRows,
sortExpressions, filterExpressions);
model.AnswerPointsList = data.Data.OfType<DenemeClass>().ToList();
model.Count = data.Count;
return
model;
}
public
class
DenemeClass
{
public
Guid Id
{
get
;
set
;
}
public
string
SurveyMainPointId
{
get
;
set
;
}
public
string
Code
{
get
;
set
;
}
public
string
Description
{
get
;
set
;
}
public
int
Point
{
get
;
set
;
}
public
int
? IconId
{
get
;
set
;
}
public
int
? Sequence
{
get
;
set
;
}
public
bool
isActive
{
get
;
set
;
}
}
It may not be related with radgrid but i guess you good people could help me. Thanks.