I have a DevExpress grid that needs to be updated every time a value is changed in combobox. For example, I have a combo box that sets the size of the grid page. One of the requirements is that combobox does not cause a complete reverse gear.
The mapping is declared as follows:
<asp:DropDownList ID="cboPages" AutoPostBack="false" runat="server" EnableViewState="false" OnSelectedIndexChanged="cboPages_SelectedIndexChanged" />
In the selected index is modified, it sets a cookie whose value is the selected value. When the combobox value changes, the javascript function is called:
function PerformCallbackOnGrid(grid) { try { grid.PerformCallback("refresh"); } catch(err){ alert('Could not perform callback on grid.'); } }
The function is added to the code behind:
this.cboPages.Attributes["onChange"] = "PerformCallbackOnGrid(" + this.GridClientID + ")";
After completing the following steps:
- The user resizes the grid page using combobox, so PerformCallback is called at least once.
- User presses F5 (update).
- The user again tries to resize the page.
an "Invalid view" error message appears.
I tried to set ViewStateMode to Disabled for the grid, also EnableViewState = "false".
source share