Telerik blogs

With RadControls for ASP.NET AJAX Q3 Beta we have provided great client-side data-binding improvement for the grid and now you can bind your data to any web service or page method completely codeless:

...  
<ClientSettings>   
   <DataBinding Location="MyWebService.asmx" SelectMethod="GetDataAndCount" /> 
...  
 

Using this new approach you can get both data and total items count in a single request and if you turn on client-side caching the grid will perform request to the server only when needed!

I'm really excited to announce that we extended this even more and now you specify following new properties:

SortParameterType - SelectMethod sort expressions argument type. Can be set to "String", "List", "Linq" and "Oql". Default is "List".

FilterParameterType - SelectMethod filter expressions argument type. Can be set to "String", "List", "Linq" and "Oql". Default is "List".

DataPropertyName - "Data" property name for the SelectMethod which will be requested to get both data and count. Default is "Data"!"

CountPropertyName - "Count" property name for the SelectMethod which will be requested to get both data and count. Default is "Count"!"

These new properties can be integrated very easily with our new static method - RadGrid.GetBindingData().

With this new method we moved our LINQ support to the next level and now you can simply pass your LINQ to SQL context type name and table name along with all other parameters for paging, sorting and filtering and the grid will perform everything automatically exactly the same as LinqDataSource.

Example:

...  
<ClientSettings>   
   <DataBinding Location="MyWebService.asmx" SelectMethod="GetDataAndCount"    
       SortParameterType="Linq" FilterParameterType="Linq" EnableCaching="true" />   
</ClientSettings> 
... 
[System.Web.Services.WebMethod]   
public Telerik.Web.UI.GridBindingData GetDataAndCount(int startRowIndex, int maximumRows, string sortExpression, string filterExpression)   
{   
    return Telerik.Web.UI.RadGrid.GetBindingData("DataClassesDataContext""Customers", startRowIndex, maximumRows, sortExpression, filterExpression);   

 

Enjoy!

[Download]


About the Author

Vladimir Enchev

is Director of Engineering, Native Mobile UI & Frameworks

Comments

Comments are disabled in preview mode.