Rauf,
There is no means to 'dynamically' add columns to a grid. Additionally, there is no means to 'dynamically' move the location of any columns within a grid.... I here you, bad news.
Last year I had a project that required the grid to be dynamic... The client wanted grid columns to display, based on different types of values. Basically - they wanted the grid to be a pivot table. I ended up adding as many columns as the client said they would ever need (plus more, because clients never know how many they need). I did not tie the 'dynamic' columns to a BSVW. As the BSVW was read, I populated the columns based on the sequence/value of the data in field... writing the values across the grid BUFFER, the writing the grid row buffer when the key values changed. Additionally - after the grid was populated, I did the Hide/Show column based on which columns had valid values.
Painful and a lot of repetitive programing that cannot take place in a NER (has to take place in the application due to App ER System Functions).
Regards
(db)