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.

Grid loses link on sorting

Thread ID:

Created:

Updated:

Platform:

Replies:

88529 Jul 28,2009 08:02 PM Jul 29,2009 12:38 PM ASP.NET MVC (Classic) 2
loading
Tags: Grid
Eric Swann
Asked On July 28, 2009 08:02 PM

On my grid, I have basic link to an edit page as suggested in your "CRUD" example. However, as soon as I sort a column, all the links disappear and the text appears unformatted. How can the link state be maintained on sorting?

Balaji K [Syncfusion]
Replied On July 29, 2009 10:32 AM

Hi Eric,

Thanks for evaluating Syncfusion products.

The Grid HTML content is replaced internally after the Sorting.
So only edit link not available after the sorting.

You can handle QueryCellInfoEvent in pagingsortingMapper Action method and the link has to be appended to the cell value

Please refer the following code snippet:

[C#]
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult SortingAction()
{
IEnumerable data = new StudentDataContext().Student;
ActionResult result = data.GridActions();
GridHtmlActionResult engineSource = result as GridHtmlActionResult;
engineSource.GridModel.QueryCellInfo += (sender, args) =>
{
if (args.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell || args.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell)
{
/// Edit link is applied in Title column
if (args.TableCellIdentity.Column.MappingName.Equals("ID"))
{
/// Hyperlink is appended inside the cell value
args.Style.CellValue =""+ args.Style.CellValue+"";

}
}
};

return result;
}

Please let us know if this helps.

Regards,
Balaji

Eric Swann
Replied On July 29, 2009 12:38 PM

Yes, this did work!

Thanks,

Eric

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.

;