I need to programmatically pin the first four colums...I'd also like to do this without showing the pins, i dont want the user to pin/unpin, i just want the first four columns not to go away when i scroll to the right...this should be simple and i cant find it anywhere.
UltraWinGrid
thanks,
private void ultraGrid1_InitializeLayout(object sender, InitializeLayoutEventArgs e) { e.Layout.UseFixedHeaders = true; e.Layout.Override.FixedHeaderIndicator = FixedHeaderIndicator.None; for (int i = 0; i < 4; i++) { e.Layout.Bands[0].Columns[i].Header.Fixed = true; } }
is there any reason why the InitializeLayout event never fires? The only layout i've been able to modify has been the DisplayLayout property
I was able get this working by modifying these values in my constructor
grid.DisplayLayout.UseFixedHeaders = true;
grid.DisplayLayout.Override.FixedHeaderIndicator = FixedHeaderIndicator.None
for (int i = 0; i < 4; i++){ grid.DisplayLayout.Bands[0].Columns[i].Header.Fixed = true;}
But I still don't understand why InitializeLayout event never fires
i had this code and a breakpoint and it never triggered
this line does execute:view.Grid.grid.InitializeLayout += new InitializeLayoutEventHandler(grid_InitializeLayout);
but this method in the same class never gets called:
void grid_InitializeLayout(object sender, InitializeLayoutEventArgs e)
{
e.Layout.UseFixedHeaders = true;
e.Layout.Override.FixedHeaderIndicator = FixedHeaderIndicator.None;
for (int i = 0; i < 4; i++)
e.Layout.Bands[0].Columns[i].Header.Fixed = true;
}