Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
486
Unbound Ultrawebgrid
posted

Hi

 I am using ultrawebgrid with unbound & multiheader columns to populate data. Data is getting populated correctly . But when the page is postbacked grid is refreshed without maintainng its state even though I am maintaining state while creating columns an headers.

Second issue is some multiheader captions are not displayed properly even though a caption is specified.

If for testing if I display all header captions in a messagebox it shows right captions but no captions are displayed on grid.

 

Please help me on this  

 

Parents
  • 45049
    posted

    My initial suspicion is that your columns and headers may not be getting stored in ViewState.  I'm more familiar with columns, as opposed to multi-header columns, but I suspect the cause may be similar.

     I suspect you're defining your columns in one of the following two ways (C#, assuming you've declared a using statement for the Infragistics.WebUI.UltraWebGrid namespace)

    UltraGridColumn col1 = this.ultraWebGrid1.DisplayLayout.Bands[0].Columns.Add("MyNewColumn1");

    UltraGridColumn col2 = new UltraGridColumn("MyNewColumn2");
    // set other properties on col2 here
    this.ultraWebGrid1.DisplayLayout.Bands[0].Columns.Add(col2);

    Either of the above two lines will create a column that won't be stored in veiwstate, and thus won't be kept correctly when you post back.  Instead, create the column in the following manner (again C# with the same using statement):

    UltraGridColumn col3 = new UltraGridColumn(true); // true = track thsi column in ViewState
    // set other properties on col3 here
    this.ultraWebGrid1.DisplayLayout.Bands[0].Columns.Add(col3);

    The same approach also applies to rows.  Since the ColumnHeader class also has a constructor that takes a boolean parameter, I suspect it also behaves the same way.

Reply Children