Dynamic GridView with Dynamic Column

Discussion in 'ASP .Net Building Controls' started by bsm, May 15, 2007.

  1. bsm

    bsm Guest

    I want to create Gridview dnymically. Because I need to achieve the
    following task on it.

    1. The Data source may contain different columns based on the user
    2. I want to find DateTime column and format the same as I like. (MMM
    3. I don't want to use RowDataBound event. Because GridView may have 1
    lakh record. So if we use RowDataBound, it will execute for each and
    every rows.

    For the above I tried to create Dynamic GridView, but When user clicks
    hyperlink column, GridView disappeared,

    Any idea to solve this.

    Thanks in Advance!!!
    bsm, May 15, 2007
    1. Advertisements

  2. bsm

    Riki Guest

    I suggest still going for the GridView itself.
    1) use autogeneratefields=true
    2) handle the OnCreateAutoGeneratedColumn event and modify your column there
    3) RowDataBound is executed for every row anyway (internally), there's no
    big penalty for handling it. But with method 2) you can avoid it.

    Riki, May 15, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.