What code needs to be used to freeze columns within an ultrawebgrid?
What do you mean by "freeze"?
To lock a column on the left side of the grid and allow the rest of the columns in the grid to scroll.
e.Layout.UseFixedHeaders = True
e.Layout.Bands(0).Columns(0).Header.Fixed = True
e.Layout.Bands(0).Columns(1).Header.Fixed = True
e.Layout.Bands(0).Columns(2).Header.Fixed = True
e.Layout.Bands(0).Columns(3).Header.Fixed = True
OK, you've got me stumped!
Wild guess: Does the InitializeLayout event handler execute when you don't bind to a datasource?
Interesting. You're correct. It doesn't go to the event when I populate the grid. It does go to the event if the datasource is assigned. Is there another event that would run this code?
I put it in the load method and that worked.
Hello,
I am facing problem in freezing the columns in my grid, The moment I add below code in the Initialize event the grid columns are kind of squezed to 0 width and I lose styles also. here is my code.Please help me out in solving this issue
{
e.Layout.UseFixedHeaders = true;
e.Layout.Bands[0].Columns[2].Header.Fixed = true;
e.Layout.Bands[0].Columns[4].Header.Fixed = true;
}
Thanks in advance,
Chaitanya...