public static void RefreshAndAutoSize(Infragistics.Win.UltraWinGrid.UltraGrid ultraGrid) { try { ultraGrid.DataBind(); foreach (UltraGridBand band in ultraGrid.DisplayLayout.Bands) { foreach (UltraGridColumn column in ultraGrid.DisplayLayout.Bands[band.Key].Columns) { column.PerformAutoResize(PerformAutoSizeType.AllRowsInBand); } } ultraGrid.Refresh(); } catch { } }
public static void RefreshAndAutoSize(Infragistics.Win.UltraWinGrid.UltraGrid grid) { //grid.DataBind(); grid.ActiveRow = null; foreach (Infragistics.Win.UltraWinGrid.UltraGridColumn ugc in grid.DisplayLayout.Bands[0].Columns) { ugc.PerformAutoResize(PerformAutoSizeType.AllRowsInBand); } grid.Refresh(); }