Hi I have a web service I am trying to get working to bind data to grid:
the above doesnt work, anyone have an example of a working WCF webservice that is bound from a stored procedure?
| [OperationContract] |
| public ResultData GetDataAndCount(int startRowIndex, int maximumRows, string sortExpression, string filterExpression) |
| { |
| GridBindingData data = RadGrid.GetBindingData("Waivenet.DataClassesDataContext", "productAttrib", startRowIndex, maximumRows, sortExpression, filterExpression); |
| ResultData result = new ResultData(); |
| //var products = DataClassesDataContext.uspGetProductsByCategory(SessionWrapper.userID); |
| //data.Data = DataClassesDataContext.uspGetProductsByCategory(SessionWrapper.userID); |
| result.Data = data.Data.OfType<DataClassesDataContext.uspGetProductsByCategory(SessionWrapper.userID)>().Select(p => new Product() |
| { |
| productID = p.productID, |
| productCode = p.productCode, |
| name = p.name, |
| description = p.description, |
| quantType = p.quantType, |
| sellPrice = p.sellPrice, |
| uom = p.uom, |
| imageThumb = p.imageThumb, |
| categoryID = p.categoryID |
| }).ToList(); |
| result.Count = data.Count; |
| Debug.WriteLine("row index: " + startRowIndex + ", max rows:" + maximumRows + ", sort expression: " + sortExpression + ", filter expression: " + filterExpression); |
| return result; |
| } |