enableAutoWidth(true);

This question has to have an obvious answer that I’m just missing. I am trying to use enableAutoWidth(true); to resize the grid container to hold all columns without scrolling and it has not been working. I’ve tried different placement in the grid and removing column width coding to no avail. Is there html/css on the grid container I need to change to make this feature work correctly? I want the initial grid to be a set pixel size, but if the column content exceed that size I’d like the container to be resized to accomodate the larger grid.

The enableAutoHeight(true); works beautifully for the vertical. Any help with the horizontal?

Thanks!

Grid Script:

var mygrid;
		  function doInitGrid(){
		  mygrid = new dhtmlXGridObject('mygrid_container');
		  mygrid.setImagePath("../codebase/imgs/");
		  mygrid.setHeader("Name,HW,CW,SUM,FORM,TK,GG,BK,All Cat,% W/Removal,% Standard");
		  mygrid.setInitWidths("*,*,*,*,*,*,*,100,100");
		  mygrid.setColAlign("left,left,left,left,left,left,left,left,left,center,center");
		  mygrid.setSkin("light");
		  mygrid.setColTypes("ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro");
		  mygrid.enableAutoHeight(true); // auto size container height for grid
		  mygrid.enableAutoWidth(true); // auto size container width for grid
		  mygrid.setStyle("","","","background-color:#F4AE28;");
		  mygrid.init();
		  mygrid.loadXML("data9.xml");

Container HTML:

<div id="mygrid_container" style="width:600px;height:200px;"></div>

Try to set fixed size for each column in grid

mygrid.setInitWidths("100,100,100,100,100,100,100,100,100");

Thanks Olga, I’ll give that a try. I also think the parent container is contributing to the problem as well and am looking in to setting it’s width to 100% instead of a set pixel width.