I want to resize the columns based on the cells' text in all the rows. The grid's data source is set to a BindingSource. After setting the BindingSource's DataSource property to a list of entities, I want to resize the columns in the grid after it finished loading the data.
Is there any event that announces that? Or is there any event that tells me that the visible rows finished loading from the data source?
Thanks.
Hi,
Please let us know if you have additional questions regarding Mike's solution or how to resize the columns based on the cell's text.
DataBinding is an ongoing process, so it's never "finished". So no, there is no event for this.
But you don't need one. You can just do this:
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { UltraGridLayout layout = e.Layout; layout.PerformAutoResizeColumns(false, PerformAutoSizeType.AllRowsInBand); }