[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.buildingcontrols

ViewState problem: When Composite Control Inside Custom GridView

Amit

3/7/2008 5:25:00 AM

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