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
|
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!
|
Rank: Advanced Member Groups: Member
Joined: 8/24/2007 Posts: 130
|
Ok, thank you
|