Hi
I wana to fetch page size of radgrid record from data base , but in your online demo code , you used (select * from xxx) !...
in this link
http://demos.telerik.com/aspnet-ajax/grid/examples/performance/linq/defaultcs.aspx
you talk about performance ! but if my table has a lot of recored , why i should fetch all of them ???
In asp.net 4.5 for " asp:GridView " control i can use this code :
public IEnumerable<SearchProvince> GetProvinces(int startRowIndex, int maximumRows, out int totalRowCount,
[System.Web.ModelBinding.Control("pID")]int? provinceId,
[System.Web.ModelBinding.Control("pName")] string provinceName)
{
using (var db = new XXXEntities())
{
IQueryable<Province> list =
(from p in db.Provinces
select new SearchProvince { ProvinceID = p.ProvinceID, ProvinceName = p.ProvinceName }).OrderBy(
p => p.ProvinceName);
if (provinceId > 0)
{
startRowIndex = 0;
list = list.Where(p => p.ProvinceID == provinceId);
}
if (!string.IsNullOrWhiteSpace(provinceName))
{
startRowIndex = 0;
list = list.Where(p => p.ProvinceName.StartsWith(provinceName));
}
totalRowCount = list.Count();
return list.Skip(startRowIndex).Take(maximumRows).ToList();
}
}
How can i implement this code for RadGrid ?
thanks