Grid from HTML multiple problems

I have php script that generates table which I transform to html grid.

<table class='dhtmlxGrid' name='grid2'   imgpath='../lib/imgs/' onbeforeinit='before()' oninit='after()'   >

In this grid I want drag-scrolling so I use this:

also i want fixed column header as its defaul. But the problem is that drag-scrolling works only with height and width setted to ‘auto’ but it’s disable column header scrolling function. If I set width and Height to ‘100%’ header works fine but not drag-scrolling. Its looks like that dhtmlx divided table into two tables one with header and one with content both generated into ‘

’. I cannot attach function to this
because its id is variable
Also I want fixed first 2 columns of grid (for horizontal scrolling) but I cannot attach any function to this div either.
Is there any way to make work drag-scrolling with fixed scrollable column header and first two columns? Or how can I set id to div which is generated when the table is transformed to dhtmlxGrid?

Please, try to use the following:

mygrid.hdrBox //access to header of the grid. mygrid._fake.entBox //access to the frozen body of the grid mygrid._fake.hdrBox //access to the frozen header of the grid