i have 2 models User and Calls with User has many Calls relationship.now i need to show data in cGridview,data is showing correctly but i need to apply sorting.in cGridview i had an attribute ‘Called?’ Which have value ‘yes’ or ‘no’ which represent if Calls Model Have a record corresponding to User.i am using a function in controller to show ‘yes’ or ‘no’ in cGridview based on Calls model have an entry or not. How can i implemet sorting on this field?thanks in advance
Please can anybody tell me if i use a function to show value of a colomn in gridview and this function show value from database but if the value is not available in database then it show ‘no’ custom text.can anybody tell be how can i sort this colomn.thanks in advance.can somebody show this by example?thanks in advance
This is a kind of STAT relation. It’s relatively easy to display it in the grid.
But in order to filter/sort by this kind of calculated data, you need to do some trick. In short, we can make use of sub query in SELECT clause and in WHERE clause when we define the criteria.