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
119
Expanding columns to show all texts
posted

Hi again, there is a property in DataGridView called "AutoSizeColumnsMode". If the value of this property is set to "AllCells", the columns will expand to show all the texts they contain. Naturally, horizontal scroll bars will appear if the columns can't be fitted into the size of the DataGridView.

I need the same functionality in UltraGrid. I've searched through the forum but couldn't find any. Tried various properties but couldn't get the effect. Could you excellent people help me out again here please?

 

Edit Note: if no such property exists, could someone point me to the property that makes the grid fill up the whole size? I found that property but seems I lost it now and can't find it again. Although I would really prefer the first option.

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    This can be done in the WinGrid, but not by a property. It's a method:


            private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
            {
                e.Layout.PerformAutoResizeColumns(false, PerformAutoSizeType.AllRowsInBand);           
            }

    This method to autosize all of the columns was added in v8.3. In any prior version, you will need to loop through the columns and call PerformAutoResize on each one.

    sari211 said:
    Edit Note: if no such property exists, could someone point me to the property that makes the grid fill up the whole size? I found that property but seems I lost it now and can't find it again. Although I would really prefer the first option.

    The property you are looking for is AutoFitStyle.

Children