Hi!
I did not tested, by I think the problem is in the following:
When grid gets a focus, it scroll the grid automatically to display the active cell. During form starting active cell is 0,0. When you scroll grid in some panel and leave that panel active, and when grid is athe first control on the form that gets focus, the grid will be automatically scrolled back to show the first cell. Auto-scrolling also happens when grid is refreshed.
So, your code should be following:
....
.Panel = 1
.DoScroll(5)
.DoScroll(5)
.Panel = 0 && Set panel to 0 so grid will not auto-scroll !!!
This will assure that active panel is 0 (in which column 1 is visible) when form is refreshed and activated.
HTH.
>Hi vlad, where will i call the doscroll event of the grid? Will I call it in the init of the form? I noticed something unusual with the doscroll() method. The code is show below.
>
>In the init of the form, i put these codes
>
>With thisform.ni_Sysgrid1
> .NI_Column7.NI_cboCompID.rowsource = "noninv.itemid"
> .NI_Column7.NI_cboCompID.value = ""
>
> .RecordSourceType = 1
> .RecordSource = " "
> .RecordSource = "Dispatch"
> .column1.ControlSource = "Dispatch.active"
> .column2.ControlSource = "Dispatch.itemid"
> .column3.ControlSource = "Dispatch.desc"
> .column4.ControlSource = "Dispatch.balance"
> .NI_Column5.ControlSource = "Dispatch.serial"
> .NI_column6.ControlSource = "Dispatch.unitprice"
> .NI_Column7.ControlSource = "Dispatch.compid"
>
>
> .Panel = 1
> .DoScroll(5)
> .DoScroll(5)
>Endwith
>
>if i execute this code with set step on, the code runs perfectly, but when i remove the set step on, the grid starts on the first column again. Is there something wrong with the code?
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.