when I tried code bellow I can not fire the event of column resize when adjust the columns width
UltraGridBand band = UltraGrid1.DisplayLayout.Bands[0];band.UseRowLayout = true;
UltraGridColumn column = null;
RowLayoutColumnInfo info = null;
column = band.Columns["Column1"];
column.Header.Appearance.TextHAlign = HAlign.Center;
info = column.RowLayoutColumnInfo;
info.PreferredCellSize = new Size(1, 1);
info.MinimumCellSize = new Size(1, 1);
info.SpanX = 2;
info.SpanY = 1;
info.OriginX = 0;
info.OriginY = 0;
column = band.Columns["Column2"];
info.SpanX = 1;
info.OriginY = 1;
column = band.Columns["Column3"];
info.OriginX = 1;
any good idea? thanks in advance
Hi,
i don't know what you will do exactly but in your code you don't resize columns. I don't know if PreferredCellSize will affect a column resize. Maybe you change the column.MinWidth and column.MaxWidth to adjust. Then the ColumnResize event will be fired I thnik.
Hope this will help
I use these code to build my grid, and when i try to adjust the column size by clicking the boundary of column, can not fire the column sized event, i use the event AfterColPosChanged.
Hm... do you want to resize a column to a min size when clicking the boundery of the column to fit it?Then use column.MinWidth in the InitializeLayout event of the grid. Then the column will not resized smaller as the column.MinWidth.Otherwize please describe a little bit more detailed what you want to do.
thanks all, it works when using AfterRowLayoutItemResized .
If you are using RowLayouts, then you need to use the AfterRowLayoutItemResized event.