ViewState problem: When Composite Control Inside Custom GridView

Discussion in 'ASP .Net Building Controls' started by Amit, Mar 7, 2008.

  1. Amit

    Amit Guest

    Hi,

    I have an issue while implementing Custom GridView control. My custom
    implementation is as below:

    Implementation:

    I have implemented custom EnhancedGridView class inherited from “GridViewâ€
    class. For this custom GridView control I want to implement Search and Paging
    functionality.

    To implement Search and Paging functionality, I have implemented two
    separate CompositeControls as below:

    EnhancedGridViewSearch : Comprises server controls like TextBox, DropDown
    and Button
    EnhancedGridViewPager :

    I am creating above mentioned composite controls in overridden
    CreateChildControls(IEnumerable dataSource, bool dataBinding) method of
    EnhancedGridView class.

    The expected functionality of these controls works fine but I am facing
    following problem.


    Issue:

    After entering Search criteria in the fields of EnhancedGridViewSearch
    control and if I press “Run Search†button of this control, after post back,
    GridView is populated with new set of data as per the search criteria
    specified, but view state of the search controls (TextBox, DropDown) in
    EnhancedGridViewSearch is not maintained after post back.

    I think this is the problem since CreateChildControls () method of
    EnhancedGridView class is called twice first time after PostBack and second
    time after GridView is bind to a new set of data.

    I need some sort solution to maintain the ViewState of child controls of
    Composite Controls that are built inside GridView class.

    I am desperately seeking help for this issue.
    Please share your thoughts if you have something.

    Thanks in Advance
    Regards
    Amit
    Amit, Mar 7, 2008
    #1
    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. Replies:
    0
    Views:
    707
  2. Replies:
    1
    Views:
    357
    Teemu Keiski
    Jul 2, 2003
  3. Chad
    Replies:
    0
    Views:
    209
  4. dickster
    Replies:
    0
    Views:
    217
    dickster
    Dec 8, 2005
  5. whoisnidhee

    ViewState of the Composite Control composed of custom control

    whoisnidhee, Jul 14, 2004, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    312
    Nidhee
    Jul 16, 2004
Loading...

Share This Page