Welcome Guest Search | Active Topics | Sign In | Register

raiseItemCommandEvent in callback running mode Options
Mike Wynn
Posted: Thursday, September 2, 2010 10:15:22 AM
Rank: Advanced Member
Groups: Member

Joined: 8/24/2007
Posts: 130
Hi,

I am using a Grid control in callback running mode. I have a situation where I wish to modify the Page Size based on the selection on a dropdown list. I am attemtping to achieve this by calling the raiseItemCommandEvent on the grid in the dropdown onChange event.

function OnPageSize() {
eo_GetObject('dgResults').raiseItemCommandEvent(-1, 'resize');
}

I have then handle the grid OnItemCommand event server size to re-bind the Grid.

protected void OnItemCommand(object sender, GridCommandEventArgs e)
{
dgResults.PageSize = 100;
dgResults.CurrentPage = 0;
dgResults.RecordCount = SearchResults.Count;
dgResults.DataSource = SearchResults.GetPage(0, 100);
dgResults.DataBind();
}

I am finding that although the event is firing correctly, and the page size is adjusted accordingly when stepping through the code, the grid does not get re-rendered on callback. If I change the running mode to Server, then it works fine.

Any suggestions,
Phil
eo_support
Posted: Thursday, September 2, 2010 10:19:47 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

That's normal. The Grid's Callback mode is slightly different than a regular CallbackPanel/UpdatePanel (in fact that's why the Grid's Callback mode ever exists). The Callback mode is specifically for you to update Grid data without reloading the Grid so that it works faster than reloading the Grid all together. As a result, the Grid will not be updated. If you wish to update the Grid all together, you can use a regular CallbackPanel or UpdatePanel.

Thanks!
Mike Wynn
Posted: Thursday, September 2, 2010 10:51:19 AM
Rank: Advanced Member
Groups: Member

Joined: 8/24/2007
Posts: 130
Ok, thank you


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.