Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > ViewState problem: When Composite Control Inside Custom GridView

Reply
Thread Tools

ViewState problem: When Composite Control Inside Custom GridView

 
 
Amit
Guest
Posts: n/a
 
      03-07-2008
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Managing ViewState of a dynamically created Custom Composite Server Control -(where the original is also dynamically created) dickster ASP .Net Building Controls 0 12-08-2005 09:32 AM
Losing Composite Control property that another Composite Control ... Chad ASP .Net Building Controls 0 02-01-2005 09:01 PM
Possible to create a composite control that has a child control that is a validator that validates the composite control itself? Jonathan Eric Miller ASP .Net Building Controls 2 07-22-2004 10:58 PM
ViewState of the Composite Control composed of custom control whoisnidhee ASP .Net Web Controls 2 07-16-2004 08:05 AM
Using Table control in a custom composite control. Control does not render properly in design time. jb_in_marietta@yahoo.com ASP .Net 0 07-01-2003 09:26 PM



Advertisments