locked
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

Answers

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

    else

    Display Grid with default number of columns and format.


    Rob^_^
    • 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