LinqServerModeDataSource devexpress
I have LinqServerModeDataSource as a datasource for my grid.
It works great when I use it with tables from my database but when I want to make any custom changes it doesnt work correctly for example in onSelecting event:
var Qry = from s in myContext select new {
s.UserId, S.UserFirstName, s.UserLastName, Name = s.UserLastName + s.UserFirstName };
e.QueryableSource = qry;
There is an error that Key expression is undefined
I know its linq error, but I would like to know how to create such a custom queries using LinqServerModeDataSource cause with Li开发者_JAVA百科nqDataSource there wasn such a problem.
Thank You very much for help, Bye
If you are using the Selecting event and provide a custom queryable, you should also set the e.KeyExpression parameter of this event to let the DataSource know the name of the key field.
精彩评论