Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2077
How to know when the grid has done loading data from the data source
posted

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.

  • 9190
    Offline posted

    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.

  • 469350
    Verified Answer
    Offline posted

    Hi,

    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);            
            }