createchildcontrols fires before click event

Discussion in 'ASP .Net Web Controls' started by hsnkamal@yahoo.com, Jun 26, 2007.

  1. Guest

    i have developed a web part using class library.when i clicked a
    button it displayed a datagrid.after that i want to edit it.when i
    click a edit button it goes to the original position where i the last
    button.it means the grid is not visible.when i press a gain that
    button it is visible again?can anyone help me to solve this matter?
    , Jun 26, 2007
    #1
    1. Advertising

  2. Tom John Guest

    Hi

    You need to ensure that the Grid is created/displayed on every postback.

    I am guessing you are creating/displaying the Grid only after the button is
    clicked. Maybe set a flag in the ViewState to indicate whether the Grid
    should be displayed or not and query that when creating the child controls as
    to whether it should be displayed or not. Then use the button click event to
    set the ViewState flag.

    Hope this helps get you going. If you want a code sample, post what you've
    got and I'll help out.

    Cheers

    Tom John


    "" wrote:

    > i have developed a web part using class library.when i clicked a
    > button it displayed a datagrid.after that i want to edit it.when i
    > click a edit button it goes to the original position where i the last
    > button.it means the grid is not visible.when i press a gain that
    > button it is visible again?can anyone help me to solve this matter?
    >
    >
    Tom John, Jul 4, 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. Purvi T
    Replies:
    0
    Views:
    820
    Purvi T
    Oct 19, 2004
  2. Max2006
    Replies:
    2
    Views:
    1,551
    Walter Wang [MSFT]
    Sep 19, 2007
  3. Mark Sisson

    CreateChildControls Event before Click Event

    Mark Sisson, Jul 17, 2003, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    363
    Victor Garcia Aprea [MVP]
    Jul 17, 2003
  4. John Bankhead

    Event Fires after CreateChildControls

    John Bankhead, Jul 15, 2005, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    162
    Teemu Keiski
    Jul 18, 2005
  5. Mark Sisson

    CreateChildControls Event before Click Event

    Mark Sisson, Jul 17, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    190
    Victor Garcia Aprea [MVP]
    Jul 17, 2003
Loading...

Share This Page