Forums

Callback panel changes the styles of grid header.

Last post 8/13/2008 3:01 AM by Roma R (DevExpress). 1 replies.
Sort Posts: Previous Next
  • Charith R

    Callback panel changes the styles of grid header.

    8/12/2008 2:03 AM
    • Not Ranked
    • Joined on 8/7/2008
    • Posts 20

    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 

  • Roma R (DevExpress)

    Re: Callback panel changes the styles of grid header.

    8/13/2008 3:01 AM
    • Top 50 Contributor
    • Joined on 5/4/2007
    • Posts 486

    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.
More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 8:30am and 5:00pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.