How to persist the values of dynamically added template column

Discussion in 'ASP .Net Datagrid Control' started by Padmalochan Sahu, Mar 6, 2007.

  1. Hi,
    I have a requirment where i am adding dynamicall item template columns to a
    grid with all text boxes, it is showing me all cell in the grid with
    textboxes. But the problem here is while i change some values in the any cell
    (textbox) and after the click on save button, the template columns disappear.
    What is happening here is on postback of the page it is recreating the grid.
    So how do i persist the values as well as the template column of the grid
    even after the postback of the page.

    Any answer to this is highly appriciated.
    Padmalochan Sahu, Mar 6, 2007
    #1
    1. Advertising

  2. You have to re-create the dynamically added column on every postback. The
    best place for it is the Page_PreInit event.

    --
    Eliyahu Goldin,
    Software Developer & Consultant
    Microsoft MVP [ASP.NET]
    http://msmvps.com/blogs/egoldin
    http://usableasp.net


    "Padmalochan Sahu" <Padmalochan > wrote in
    message news:...
    > Hi,
    > I have a requirment where i am adding dynamicall item template columns to
    > a
    > grid with all text boxes, it is showing me all cell in the grid with
    > textboxes. But the problem here is while i change some values in the any
    > cell
    > (textbox) and after the click on save button, the template columns
    > disappear.
    > What is happening here is on postback of the page it is recreating the
    > grid.
    > So how do i persist the values as well as the template column of the grid
    > even after the postback of the page.
    >
    > Any answer to this is highly appriciated.
    Eliyahu Goldin, Mar 6, 2007
    #2
    1. Advertising

  3. Hi sahu,

    How are you? how is work going on? hope eveything is going cool for you.
    Wish you happpy and colorful holi.."

    "Padmalochan Sahu" wrote:

    > Hi,
    > I have a requirment where i am adding dynamicall item template columns to a
    > grid with all text boxes, it is showing me all cell in the grid with
    > textboxes. But the problem here is while i change some values in the any cell
    > (textbox) and after the click on save button, the template columns disappear.
    > What is happening here is on postback of the page it is recreating the grid.
    > So how do i persist the values as well as the template column of the grid
    > even after the postback of the page.
    >
    > Any answer to this is highly appriciated.
    Sushma Savekar, Mar 6, 2007
    #3
    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. Richard Dixson
    Replies:
    1
    Views:
    498
    Joe Fallon
    May 18, 2004
  2. Richard Dixson
    Replies:
    2
    Views:
    725
    Richard Dixson
    May 18, 2004
  3. ad
    Replies:
    3
    Views:
    1,004
    Alex Smith
    Jun 8, 2005
  4. Marc
    Replies:
    5
    Views:
    341
    Eliyahu Goldin
    Aug 13, 2008
  5. Sriram Mallajyosula

    Problem with persisting dynamically added custom template column i

    Sriram Mallajyosula, Mar 2, 2007, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    727
    Teemu Keiski
    Apr 9, 2007
Loading...

Share This Page