I have written code to export data to Excel. I sort columns according to the VisibleIndex property. However sometimes this property does not appear to have been set correctly and the VisibleIndex does not correspond to the column positions in the grid. I cannot reproduce this behaviour, it just happens occassionally.
Is there anything I can do to force the grid to recalculate the VisibleIndex of its columns? I thought perhaps I could find the Column with the highest VisibleIndex and change its VisibleIndex value, which would not reorder columns but might force the grid’s column collection to recalculate the VisibleIndex for all columns.
That said, how could the VisibleIndex ever be ‘wrong’ if I can see the columns in a certain order in the grid? Does the grid use a different property to sort its columns?
kh
Imported from legacy forums. Posted by kh (had 2102 views)