adding and removing dynamic column on Gridview RRS feed

  • Question

  • Hi There,

    I am having an asp GridView with 3 bound columns.
    I am adding dynamic column to that  gridview (number of columns depends on the selected value from the dropdown) on page_init.
    also those dynamic column contains textbox as a control inside.
    First time column added successfully(say suppose 4 columns), but if user reduces the number of column (say 2 columns are added now), then two column added successfully but 2 out of 4 column that are added before remains on the grid with no textbox control.

    I also change the column Header text on the RowCreated event .

    how to remove columns that are previously added?

    Thanks in advance : 
    Thursday, December 9, 2010 10:39 AM


  • If IsPostback>ReformatYour Grid based on user choice of col numbers.


    Display Grid with default number of columns and format.

    • Proposed as answer by 网游 - wang'you Thursday, December 9, 2010 7:06 PM
    • Marked as answer by Yanping Wang Wednesday, December 15, 2010 8:54 AM
    Thursday, December 9, 2010 7:06 PM