in
Forums
Blogs
DevExpress.com
Client Center
Support Center
DevExpress Channel

Callback panel changes the styles of grid header.

Last post 8/13/2008 3:01 AM by Roman R (DevExpress). 1 replies.
Sort Posts: Previous Next
  • 8/12/2008 2:03 AM

    Callback panel changes the styles of grid header.

    hi,

    im having a ASPx gridview in my page. im using a pop up window to add a new record (not the popup edit provided with the grid).

    im using a callback panel to refresh the grid after closing the popup window. it works fine but after the callback the font color i have used in grid header has been changed from white to black.

    if i sort a grid column by clicking on the header it comes back to the original color(white).

    can anyone explain why does this happen and a solution for it?

    thnx.

    //charith 

  • 8/13/2008 3:01 AM In reply to

    Re: Callback panel changes the styles of grid header.

    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.
Copyright © 1998-2010 Developer Express Inc.
ALL RIGHTS RESERVED