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
550
Issue in freezing a column and making other columns of the grid as resizable
posted

I have a requirement  to freeze the first column of the grid and also keep its header fixed. The remaining columns of the grid should not be frozen and I should be able to resize the columns. The grid should be scrollable both verically and horizontally.

I have implemented the above stated requirement using infragisctics UltraWebGrid and I could make the first column frozen and the grid scrollable. But when I try to resize the remaining columns of the grid, some run-time javascript error  is thrown. The error is:

 " 'undefined' is null or not an object"

 I am not able to resolve this issue. Kindly help me with is.

Below is the code for the InitializeLayout event of the grid with 4 columns.

Protected Sub UltraGrid_InitializeLayout(ByVal sender As Object, ByVal e As LayoutEventArgs) Handles UltraWebGrid1.InitializeLayout

e.Layout.UseFixedHeaders =

 

True

e.Layout.AutoGenerateColumns = 

 

False

e.Layout.TableLayout = 

 

TableLayout.Auto

e.Layout.AllowColSizingDefault =

 

AllowSizing.Free

e.Layout.AllowSortingDefault =

 

AllowSorting.OnClient

 

 

e.Layout.RowHeightDefault = Unit.Percentage(10)

e.Layout.HeaderClickActionDefault =

 

HeaderClickAction.NotSet

e.Layout.RowSelectorsDefault =

 

RowSelectors.Yes

e.Layout.RowSizingDefault =

 

AllowSizing.Free

e.Layout.StationaryMargins =

 

StationaryMargins.HeaderAndFooter

e.Layout.ViewType =

 

ViewType.Flat

e.Layout.SelectTypeCellDefault =

 

SelectType.Extended

e.Layout.SelectTypeRowDefault =

 

SelectType.Extended

 

 

UltraWebGrid1.Bands(0).SortedColumns.Add(UltraWebGrid1.Columns(1))

UltraWebGrid1.Bands(0).SortedColumns.Add(UltraWebGrid1.Columns(2))

 

 

 

With e.Layout.Bands(0).Columns(0)

.AllowUpdate =

 

AllowUpdate.Yes

 

 

 

.AllowResize = AllowSizing.Fixed

.Header.Fixed =

 

True

 

 

 

End With

With

e.Layout.Bands(0).Columns(1)

.SortIndicator =

 

SortIndicator.Ascending

.AllowResize =

 

AllowSizing.Free

 

 

 

.Header.ClickAction =

 

HeaderClickAction.SortMulti

.Header.Fixed =

 

False

 

 

 

End With

 

 

 

With

e.Layout.Bands(0).Columns(2)

.SortIndicator =

 

SortIndicator.Ascending

.AllowResize =

 

AllowSizing.Free

.Header.ClickAction =

 

HeaderClickAction.SortSingle

.Header.Fixed =

 

False

 

 

 

End With

 

 

 

With

e.Layout.Bands(0).Columns(3)

.SortIndicator =

 

SortIndicator.Disabled

.AllowResize =

 

AllowSizing.Free

.Header.Fixed =

 

False

 

 

 

End With

 

 

 

End Sub