Hi
That happens, because the standard ASP.NET property storage (ViewState) isn't preserved between standard callbacks.
The ASPxGridView preserves only those properties that are related to its state, for example, sorting, groping, filtering, etc.
It preserves properties using its own hidden filed.
If you change other properties during a callback, they will lose their values during the next callback.
There are two ways to resolve this situation.
1. Use the ASP.NET AJAX UpdatePanel instead of ASPxCallBackPanel. It has full control over requests and preserves the ViewState.
2. Use a flag, which will show that the property has been changed. You should implement something like the following:
protected void Page_Load(object sender, EventArgs e) {
if(Session["ColorChanged"] != null)
grid.MyColorProperty = myColor;
}
protected void ASPxGridView1_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e) {
if(e.Parameters == "ChangeColor"){
Session["ColorChanged"] = true;
grid.MyColorProperty = myColor;
}
}
Thanks, Roman
R&D, .Net Team, DevExpress
PS. If you wish to receive direct assistance from our Support Team, use
Support Center.