Code:
UltraGrid1.DisplayLayout.Bands(0).Columns(0).Header.Fixed = True
*obviously, by replacing the 0 in columns with your column's index
But if you are using the designer you can bulk more columns at once
i personnaly dont like the col. freeze functionality in infragistics. it is causing lot of issues in you have multilined text in your grid. i requested them for a solution but they said it is a feature request but more than one and half year i didnt any solution.
if you are allowing column or row resizing features to your ultrawebgrid then forget about the freezing the 2 columns.
refer the screenshot.
If Infragistics provides a solution for this they are really great and I will appreciate that.
Arun.K.S
if i have in grid 100 columns with horisontal scroll can i set first 2 columns freez so when scroll they always show? how can i do it?
als there is a trick handled by Infragistics. they shown the column freeze example only for a grid having no CellStyle.Wrap = true.
if you have multilined text in your grid this columnfreezing code will collapse the entire gird's look and feel. i have requested to fix this issue but i got a reply it is a feature request and will be fixed in the next release. ( i faced this issue an year before) but till this date i haven't seen any fix for this.
if you know any work around kindly let me know.
One point on Merge you can use the custom implementation for the Merge.
Example:
return a column from the recordset
COLUMN DATA COLUMN COUNT
A 3A 3A 3
B 2B 2
C 1
Use column count column and mege the cell data that needs the merge functionality. Just a thought :) I am not sure how does it fit your requirement.
2) Freezing Columns
From your sample I observed you are using the Ultragrid object but in the Initilize event you will not get that object use the eventorg e to handle the scenario as you can find it below>
{
e.Layout.TableLayout = TableLayout.Fixed;
e.Layout.Bands[0].Columns[2].Header.Fixed = true;
e.Layout.Bands[0].Columns[4].Header.Fixed = true;
}