ThanksStefano, very helpful Regards
-- David ----- Original Message ---- From: Stefano Palmeri <[email protected]> To: mailing list for gambas users <[email protected]> Sent: Sunday, August 2, 2009 3:22:09 AM Subject: Re: [Gambas-user] Column auto reseize in tables views. Il sabato 1 agosto 2009 19:36:51 David Villalobos Cambronero ha scritto: > Hi all, > > How can I automaticly auto resize the column width of my gridview or > tableview. I mean, when I show the view, I want all the columns adjusted to > the cell content. > > Regards > > > -- > David You can't automatically. You could write a function to calculate the maximum length of a cell content in the same column and then change the column width. The basic thing is that you have to calculate the width of a cell content. You could do this: Dim iContentW as Integer iContentW = GridView1.Font.Width(GridView1[0,0].Text) Once you have the longest cell content, you can resize that column adding a little value. GridView1.Columns[0].Width = iContentW + 10 You have to calculate the width of all cell content of a specific row, select the longest, resize the column. Not comfortable, but not impossible. Bye, Stefano > > > > > > --------------------------------------------------------------------------- >--- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 > 30-Day trial. Simplify your report design, integration and deployment - and > focus on what you do best, core application coding. Discover what's new > with Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Gambas-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/gambas-user ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Gambas-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/gambas-user ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Gambas-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/gambas-user
