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
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 herethis.ultraWebGrid1.DisplayLayout.Bands[0].Columns.Add(col2);
UltraGridColumn col1 = this.ultraWebGrid1.DisplayLayout.Bands[0].Columns.Add("MyNewColumn1");
UltraGridColumn col2 = new UltraGridColumn("MyNewColumn2");// set other properties on col2 herethis.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 herethis.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.
Thanks Vince for the reply.
As I said the grid is not bound. There are 3 columns and 3 rows in the column headers. And column headers are not bound/static i.e. I have to display them on a condition and these values keep changing. So even if I keep columns and headers in viewstate I get values fetched for the first time. So keeping a viewstate would not my problem.
There seems to be a problem if I specify viewstate then only row 0 of all 3 columns is maintained neither row 1 and row 2.
Can you please help
With the information provided, I can't tell why this is happening. I'm not sure if I'm missing a step, or if there's a possible bug that may need fixing.
I suggest that you submit a support request so a Developer Support Engineer can investigate this in-depth. So that we know we're looking at the same code that you're using, please include a sample project that we can run and debug along with your support request.