Telerik RadGrid CustomSorting without hitting database?

You can set the sortExpression in the OnSelecting event of the objectDatasource and use it in the SelectMethod protected void odsGridData_Selecting(object sender, ObjectDataSourceSelectingEventArgs e) { e. InputParameters"filterExpression" = grdMyTasks.MasterTableView. FilterExpression; //Set the Sort Expression and use this in the Get method e.

InputParameters"sortExpression" = grdMyTasks.MasterTableView.SortExpressions.GetSortString(); e.Arguments. StartRowIndex = grdMyTasks. CurrentPageIndex; e.Arguments.

MaximumRows = grdMyTasks. PageSize; } This way you can perform custom sort and pass on the data to the RadGrid Hope this helps.

You can set the sortExpression in the OnSelecting event of the objectDatasource and use it in the SelectMethod. Protected void odsGridData_Selecting(object sender, ObjectDataSourceSelectingEventArgs e) { e. InputParameters"filterExpression" = grdMyTasks.MasterTableView.

FilterExpression; //Set the Sort Expression and use this in the Get method e. InputParameters"sortExpression" = grdMyTasks.MasterTableView.SortExpressions.GetSortString(); e.Arguments. StartRowIndex = grdMyTasks.

CurrentPageIndex; e.Arguments. MaximumRows = grdMyTasks. PageSize; } This way you can perform custom sort and pass on the data to the RadGrid.

Hope this helps.

Here is an example of some code I use that does not hit the database. I'm using MVC 3 with the Razor view engine. Notice the Ajax binding.

Don't forget to add using Telerik.Web.Mvc. UI and annotate the "Post" methods in your controller with GridResult and to return GridModel to get the Json resultset. Using Telerik.Web.

Mvc; GridAction public ActionResult AjaxGridSelect() { return View(new GridModel(db. Lm_m_category)); } Here is the index. Cshtml (razor engine), the key is the Ajax binding.

@model IEnumerable @using Telerik.Web.Mvc. UI @(Html.Telerik(). Grid(Model) .

Name("Grid") . DataKeys(keys => keys. Add(c => c.

Category_id )) . DataBinding(dataBinding => dataBinding.Ajax() . Select("AjaxGridSelect", "CategoryTree") .

Insert("GridInsert", "CategoryTree", new { GridEditMode. PopUp, GridButtonType. ImageAndText }) .

Update("GridUpdate", "CategoryTree", new { GridEditMode. InLine, GridButtonType. ImageAndText }) .

Delete("GridDelete", "CategoryTree", new { GridEditMode. InLine, GridButtonType. ImageAndText })) .

Columns(columns => { columns. Bound(p => p. Category_name).

Width(150); columns. Bound(p => p. Status_cd).

Width(100); columns. Command(commands => { commands.Edit(). ButtonType(GridButtonType.

ImageAndText); commands.Delete(). ButtonType(GridButtonType. ImageAndText); }).

Width(180). Title("Commands"); }) . Editable(editing => editing.

Mode(GridEditMode. InLine)) . Pageable(paging => paging.

PageSize(50) . Style(GridPagerStyles. NextPreviousAndNumeric) .

Position(GridPagerPosition. Bottom)) . Sortable(o => o.

OrderBy(sortcol => { sortcol. Add(a => a. Category_name); sortcol.

Add(a => a. Add_date); }) .Filterable() .Groupable() .Selectable()).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions