Dynamic GridView with Dynamic Column

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

  1. bsm

    bsm Guest

    Hi,
    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
    selection.
    2. I want to find DateTime column and format the same as I like. (MMM
    dd-yyyy).
    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
    1. Advertising

  2. bsm

    Riki Guest

    "bsm" <> wrote in message
    news:...
    > Hi,
    > 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
    > selection.
    > 2. I want to find DateTime column and format the same as I like. (MMM
    > dd-yyyy).
    > 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,


    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
    Riki, May 15, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Keithb
    Replies:
    2
    Views:
    1,112
  2. Greg Smith
    Replies:
    0
    Views:
    529
    Greg Smith
    Apr 12, 2007
  3. Replies:
    2
    Views:
    429
  4. Keith G Hicks
    Replies:
    3
    Views:
    749
    Keith G Hicks
    Feb 18, 2008
  5. johnsonlim026
    Replies:
    0
    Views:
    919
    johnsonlim026
    Feb 27, 2010
Loading...

Share This Page