That's invorrect, after the databound method the grid is bound. The columns don't exists you did not make them thus you cannot make them invisible like that. However in the RowDataBound event you can make all the cells invisible for that specific column and thus making the column invisible:
In the row data bound event do this:
e.Row.Cells(1).Visible = False
Since all the cells are invisible so is the column
Main Topics
Browse All Topics





by: expertsoulPosted on 2009-11-02 at 13:33:50ID: 25723992
You cannot hide column while calling databind() as columns are not present at that moment.
You need to call this at ItemDataBound event of the grid.