ViewState problem: When Composite Control Inside Custom GridView
I have an issue while implementing Custom GridView control. My custom
implementation is as below:
I have implemented custom EnhancedGridView class inherited from “GridView”
class. For this custom GridView control I want to implement Search and Paging
To implement Search and Paging functionality, I have implemented two
separate CompositeControls as below:
EnhancedGridViewSearch : Comprises server controls like TextBox, DropDown
I am creating above mentioned composite controls in overridden
CreateChildControls(IEnumerable dataSource, bool dataBinding) method of
The expected functionality of these controls works fine but I am facing
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
|All times are GMT. The time now is 02:07 PM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.