(NetAdvantage for ASP.NET)
If you want to freeze first few columns like EXCEL and horizontally scroll rest of the columns in Ultra WebGrid here you go…
Event :
UltraWebGrid1_InitializeLayout(object sender, Infragistics.WebUI.UltraWebGrid.LayoutEventArgs e)
VB Code :
[sourcecode language='vb']
e.Layout.UseFixedHeaders = true
e.Layout.Bands(0).Columns(1).Header.Fixed = true
e.Layout.Bands(0).Columns(2).Header.Fixed = true
[/sourcecode]
Above code freezes the two columns (second,third) in Grid.
C# Code
[sourcecode language='csharp']
protected void UltraWebGrid1_InitializeLayout(object sender, Infragistics.WebUI.UltraWebGrid.LayoutEventArgs e)
{
e.Layout.UseFixedHeaders = true;
e.Layout.Bands[0].Columns[1].Header.Fixed = true;
e.Layout.Bands[0].Columns[2].Header.Fixed = true;
}
[/sourcecode]
[...] Column Locking / Freezing in Infragistics Ultra WebGrid [...]
That didnot work. I searched Infragistics website and found this working..just two lines of code..amazing..
using Infragistics.WebUI.UltraWebGrid;
this.UltraWebGrid1.DisplayLayout.StationaryMargins = StationaryMargins.Header;
I find that both the article code works and Sairam’s code works. However, the former is for preventing columns from scrolling going right to left, while the latter if for preventing column headers from scrolling top to bottom, if that makes sense…
Is there any way to fix a row so that the first row is frozen and you can scroll the remaining rows vertically?
thd above code works fine for freezing columns and headers of the hierarchical webgrid. But its changing the column index of the 3rd band of that hierarchical grid. changing column index means, after getting data from database am binding that to the grid and while retrieving those values from webgrid the column index getting change. please reply me back , its urgent.
Nice article