Hi!

I have an MSHFlexGrid control, bound to a database. I set up the width of the columns in code, resizing them according to what data is being displayed on the grid (it changes - could be 10 digit date, 2 digit code, 15 digit total value etc).

I have labels which i place above the columns after the width has been adjusted; these labels describe what data is in the column (date,value,total etc)

I have noticed that when there is no data in the grid at all, the headers are in the wrong place. But there is nothing in the code which changes, between the case where there is no data in the grid, and the case where there is.

I`ve looked at the values involved as they are being adjusted in both cases, and i`ve found that the ColPos property of the column which i`m interested in (and which is wrong - offset 3) changes each time i adjust the width of an earlier (offset 0,1,2) column where there is data in the grid, but it doesnt change when there is no data there.

Can anyone explain why this is?

Thanks,
Alex.