Problem with dynamically created template columns and updatecomman

Discussion in 'ASP .Net' started by =?Utf-8?B?U3VtYQ==?=, Dec 21, 2004.

  1. I have a problem with editable datagrid and was hoping if anyone could help
    me. Please help me if possible.

    I have an editable datagrid, whose column count I don’t know until runtime.
    I am sure of 3 columns Id,Name and Description.

    But there also might be more. So I add these 3 columns and an
    editcommandbutton and deletecommnadbutton at design time.

    Then during runtime I insert my other columns that I need, in between
    Description and Edit columns.

    I need checkboxes in these dynamically created template columns. So I
    implement the ITemplate interface and the databinding works just fine. I give
    Ids for both checkboxes in Itemtemplate as well as EditItemTemplate.

    Now, when I say Update, in updatecommand event handler, I am not able to
    find the checkbox controls that I created for EditItemTemplate.

    I tried adding columns at every pageload, even then I can’t find the controls.

    Can anybody please help me in achieving this. It is urgent :(

    TIA
    Suma.
    =?Utf-8?B?U3VtYQ==?=, Dec 21, 2004
    #1
    1. Advertising

  2. "Suma" <> wrote in message
    news:...
    > I have a problem with editable datagrid and was hoping if anyone could
    > help
    > me. Please help me if possible.
    >
    > I have an editable datagrid, whose column count I don't know until
    > runtime.
    > I am sure of 3 columns Id,Name and Description.
    >
    > But there also might be more. So I add these 3 columns and an
    > editcommandbutton and deletecommnadbutton at design time.
    >
    > Then during runtime I insert my other columns that I need, in between
    > Description and Edit columns.
    >
    > I need checkboxes in these dynamically created template columns. So I
    > implement the ITemplate interface and the databinding works just fine. I
    > give
    > Ids for both checkboxes in Itemtemplate as well as EditItemTemplate.
    >
    > Now, when I say Update, in updatecommand event handler, I am not able to
    > find the checkbox controls that I created for EditItemTemplate.
    >
    > I tried adding columns at every pageload, even then I can't find the
    > controls.
    >
    > Can anybody please help me in achieving this. It is urgent :(


    Turn on page tracing, which will show you the control tree. See if the
    checkboxes are there, what they're within and what they're called.

    John Saunders
    John Saunders, Dec 21, 2004
    #2
    1. Advertising

  3. Re: Problem with dynamically created template columns and updateco

    I got the solution.
    Actually once I get my column lists during my first page load, I need to
    store them in session.Then in Page_Init need to add dynamic template columns
    again by retreiving them from session.
    This way my code works just fine :)

    Suma.

    "John Saunders" wrote:

    > "Suma" <> wrote in message
    > news:...
    > > I have a problem with editable datagrid and was hoping if anyone could
    > > help
    > > me. Please help me if possible.
    > >
    > > I have an editable datagrid, whose column count I don't know until
    > > runtime.
    > > I am sure of 3 columns Id,Name and Description.
    > >
    > > But there also might be more. So I add these 3 columns and an
    > > editcommandbutton and deletecommnadbutton at design time.
    > >
    > > Then during runtime I insert my other columns that I need, in between
    > > Description and Edit columns.
    > >
    > > I need checkboxes in these dynamically created template columns. So I
    > > implement the ITemplate interface and the databinding works just fine. I
    > > give
    > > Ids for both checkboxes in Itemtemplate as well as EditItemTemplate.
    > >
    > > Now, when I say Update, in updatecommand event handler, I am not able to
    > > find the checkbox controls that I created for EditItemTemplate.
    > >
    > > I tried adding columns at every pageload, even then I can't find the
    > > controls.
    > >
    > > Can anybody please help me in achieving this. It is urgent :(

    >
    > Turn on page tracing, which will show you the control tree. See if the
    > checkboxes are there, what they're within and what they're called.
    >
    > John Saunders
    >
    >
    >
    =?Utf-8?B?U3VtYQ==?=, Dec 23, 2004
    #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. David C
    Replies:
    2
    Views:
    1,162
    David C
    Dec 21, 2005
  2. msimmons
    Replies:
    0
    Views:
    449
    msimmons
    Jul 16, 2009
  3. MattB

    Column order and dynamically created columns

    MattB, Dec 1, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    128
    MattB
    Dec 1, 2004
  4. Vinki

    template columns and bound columns in gridview

    Vinki, Apr 25, 2007, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    841
    Vinki
    Apr 25, 2007
  5. springtraining
    Replies:
    0
    Views:
    307
    springtraining
    Nov 12, 2007
Loading...

Share This Page