Welcome to the Xceed Community | Help
Community Search  

If making column auto fit, they do not resize at run time

Sort Posts: Previous Next
  •  09-30-2008, 11:03 AM Post no. 15749

    If making column auto fit, they do not resize at run time

    Hi All,

      I'm making grid's column auto fit by using the code

            private void MakeGridColAutoFit(DataGridControl gridControl)
            {
                foreach (Column column in gridControl.Columns)
                {
                    double width = column.GetFittedWidth();
                    if (width > -1)
                    {
                        column.Width = width ;

                    }
                }
            }

            private void gridEmp_LayoutUpdated(object sender, EventArgs e)
            {
                MakeGridColAutoFit(gridEmp);
            }

    The problem is that if we do this, the auto fit works, but then the column does not get resize at run time. Can anyone please suggest solution for this.

     

View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.