views:

12

answers:

1

Hello,

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 LinqDataSource there wasn such a problem.

Thank You very much for help, Bye

+1  A: 

Hi,

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.

DevExpress Team
Works great for me :) Im impressed with Your team :)
gruber
But after settint KeyExpression datais displayed but when I want to insert new row firm is shown but I cant enter any data. TextBoxes doesnt respond. If I use standard table as a source everything works great. WHould I define any custom query for inserting or editing ?
gruber