0

I am using Telerik Radgrid in my Asp.Net Web application. The grid has datasource assigned from asp:EntityDataSource. There is one extra column i have added which is not a part of asp:EntityDataSource but i calculated it on ItemDataBound event of Radgrid. Now when i am trying to sort the grid with the extra column it gives me below exception. please help. i saw many similar kind of question on Stack overflow but its not related. Thanks in advance.

Exception:

'HasChangeReason' is not a member of type 'EMTModel.CarModel' in the currently loaded schemas. Near simple identifier, line 6, column 4.

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
BHAVIN
  • 1
  • You can intercept the sort event using the grid's "OnSortCommand" property. You can also set the "SortExpression" on the column to a value that is in your EntityDataSource. However, generally, if you're unable to access the column through your entitydatasource you'll probably have to use a different data source. Perhaps SQLdatasource, Objectdatasource, or manually bind to a datatable. With any of those you could likely do your calculation prior to the grid binding instead of OnItemDatabound. The other quick workaround would be to just disable sorting on that column. – cl0rkster Dec 23 '15 at 14:35
  • Thank you very much for reply. I was planning to manually sort the data on sort event. I tried to intercept the sort event using "OnSortCommand" property but in this method the DataSource property of DataTableView is null. – BHAVIN Dec 29 '15 at 05:54

0 Answers0