how to serialize header information

I am building the grid dynamically, even the header are sent over the load xml



like,



<?xml version="1.0" encoding="UTF-8"?>



    

        column 1

        column 2

        

            %

        

    

    

        abc

        def

    





number of columns are dynamic,



when i serialize i get only



        abc

        def



i need header information also, please advice.

Serialization of grid configuration can be enabled

    grid.setSerializationLevel(false,false,true)