auto resize of the grid property.

This is lokendra Ujjwal.
I Had two issues with autoresize of the grid property.
Let Me explan my problem,
1.When I set the width of columns and put any of them as * , then al those columns are hidden for which I had mention width as *.
2. First time only grid is resizing, second time when I bind the same grid , in that case is not resizing, but the rezible columns is always increase and move out of the grid width boundry.

Thanks a Lot.

Lokendra Ujjwal

Columns with () width take all available width from grid container after setting width for other columns. So if sum of width of other columns is bigger or equal to width of grid container, column with () width will not be visible as there is no free space
The same algorithm uses while column resizing.

hi,

I had the grid width is 650px.
MyWorkGrid.setInitWidths(“65,73,110,93,60,65,65,46,73”);
The totals of this columns Width is about 645.
But is I give like this-
MyWorkGrid.setInitWidths(“65,73,110,93,60,65,65,46,*”);
Then the last colums is hidden.
and not only this, if I define 2-3 columns with * width, all were hidden.
Can You help me out for this issue.

Thanks
Lokendra Ujjwal

By any chance, are you init grid in hidden container and show it later? Or change|set size of container dynamically?

Auto size columns are calculated on moment of grid’s init , and if size|visibility of grid was altered later, you need to force size recalculation by

grid.setSizes();

hi,

As you said , we also making visible the grid before binding.

document.getElementById(‘MyWorkGrid’).style.display = “inline”;

and this we are doing before creating a new object of

var MyWorkGrid= new dhtmlXGridObject(‘MyWorkGrid’);

And we try to use put MyWorkGrid.setSizes() before MyWorkGrid.init() and after .
Still all columns(whose width are *) are invisible.

Thanks .

Lokendra Ujjwal

I think you need to use

document.getElementById(‘MyWorkGrid’).style.display = “block”;

block, not inline
inline element will ignore any width related styles, which may be the reason of the problem.

hi,

Thanks a lot.This solution(Useing “block” inplace of “inline”) is working for me. :smiley:

I was trying solve this issue since last 1 week.

Thanks & Regards

Lokendra Kumar Ujjwal