We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Paging Action ver 7.403.0.20

Thread ID:

Created:

Updated:

Platform:

Replies:

91469 Nov 19,2009 11:31 AM Nov 23,2009 08:59 AM ASP.NET MVC (Classic) 1
loading
Tags: Grid
Administrator [Syncfusion]
Asked On November 19, 2009 11:31 AM

I have two grids with relation master/slave (selecting data in master grid retrieves rows in slave grid).

First problem is:

When I want to hide column on master grid (using code shown below on main aspx page) everything works until i use paging action..




....
....
function hideColumn(gridName, colName) {
var gridObj = $find(gridName);
gridObj.hideColumn(colName);
}
...
...
After retrieving second page, previously hidden column is showing itself as a last column.



Second problem is:

How to retrieve rows (or invoke any other action) on slave grid (clear it when no row is selected), after invoking paging action on master grid.

Example of pagin action:

public ActionResult Load(PagingParams args)
{



IEnumerable data = _repository.GetAll(_dictContext.Nazwa, _dictContext.Nip).ToList();
ActionResult result = data.GridActions();
var engineSource = result as GridHtmlActionResult;


ViewData["Model"] = BuildGridModel();
return result;

}



Balaji M [Syncfusion]
Replied On November 23, 2009 08:59 AM

Hi Pawel,

Thank you for your interest in Syncfusion products.

1. When I want to hide column on master grid (using code shown below on main aspx page) everything works until i use paging action..

We suggest to use JQuery ajaxSuccess event to achive this column hiding in Master_Grid. This event used to attach a any function. This attached function will be executed whenever an AJAX request completes successfully.

Please refer the below syntax.

function (event, XMLHttpRequest, ajaxOptions) {
this; // dom element listening
}


Please refer the following code snippet to achive column hiding feature.

[js]
$("#Master_Grid").ajaxSuccess(function(event, XMLHttpRequest, ajaxOptions) {
var gridObj = $find("Master_Grid");
if (ajaxOptions.type == "post") {
//Hide the Master_Grid Column
hideColumn("Master_Grid", "CustomerID");
}
});


2. How to retrieve rows (or invoke any other action) on slave grid (clear it when no row is selected), after invoking paging action on master grid.

We can achieve this through JQuery ajaxSuccess event. Here i have created a simple sample to illustrates this feature.

Refer the below code snippet, which illustrates this.

$("#Master_Grid").ajaxSuccess(function(event, XMLHttpRequest, ajaxOptions) {
var gridObj = $find("Master_Grid");
if (ajaxOptions.type == "post") {
//Hide the Master_Grid Column
hideColumn("Master_Grid", "CustomerID");
//To call the slave grid.
$("#OrderID").val(0);
SubmitMvcAjaxForm("Child_form");
}
});

The sample illustrates,

1. Master_Grid contains the Order Information where as Child_Grid is contains the Order_details.
2. During the OnRecordSelect event the Child Table generates the corresponding order_details values in child Grid.
3. During the paging action, the child_grid cleared using .ajaxSuccess event.

Please refer the sample from the below link.
http://help.syncfusion.com/support/grid_mvc/v7.4.0.20/F91469/Sample.zip

Please let us know if you have any concerns.

Regards,
M. Balaji.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;