Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Dynamic gridview values lost on postback

Reply
Thread Tools

Dynamic gridview values lost on postback

 
 
Bryan
Guest
Posts: n/a
 
      08-22-2006
Hi all,

I am developing an application that uses a GridView that has its
columns added dynamically.

The user selects from a Drop Down List of offices, this populates a
list of employees, the user selects one.

Clicking the "Add_Emp" button adds column relating to this employee to
a DataTable myDT, the DataTable is then bound to the GridView. All is
working fine here.

I also store the myDT in the session so that I can repopulate the
gridview on postback with the information for the DataTable


The problem -
When the user makes changes to the CheckBoxes in the Gridview, I
want to update the DataTable before it is used to repopulate the
GridView.

But, the GridView is empty on postback because it is dynamic.

Please give me suggestions on this.

Thanks,

Bryan

 
Reply With Quote
 
 
 
 
Vadivel Kumar
Guest
Posts: n/a
 
      08-23-2006
I guess, grid view shouldn't be empty if you have ViewState enabled for
that control. Even in postback condition you can track the CheckBox state.

Check for the ViewState and AutoPostBack properties.

--
Vadivel Kumar
http://www.vadivelk.net
http://www.velocityreviews.com/forums/(E-Mail Removed) (remove "online.")

Bryan wrote:
> Hi all,
>
> I am developing an application that uses a GridView that has its
> columns added dynamically.
>
> The user selects from a Drop Down List of offices, this populates a
> list of employees, the user selects one.
>
> Clicking the "Add_Emp" button adds column relating to this employee to
> a DataTable myDT, the DataTable is then bound to the GridView. All is
> working fine here.
>
> I also store the myDT in the session so that I can repopulate the
> gridview on postback with the information for the DataTable
>
>
> The problem -
> When the user makes changes to the CheckBoxes in the Gridview, I
> want to update the DataTable before it is used to repopulate the
> GridView.
>
> But, the GridView is empty on postback because it is dynamic.
>
> Please give me suggestions on this.
>
> Thanks,
>
> Bryan
>

 
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
Dynamic Controls Lost On Postback vcuankitdotnet ASP .Net 5 04-18-2007 07:35 PM
UserControl values lost on PostBack paul.hester@gmail.com ASP .Net Web Controls 1 08-31-2006 08:41 AM
UserControl values lost on PostBack paul.hester@gmail.com ASP .Net Building Controls 1 08-30-2006 11:04 AM
UserControl values lost on PostBack Paul ASP .Net 1 08-30-2006 07:15 AM
Dynamic Gridview VIEWSTATE lost on postback K B ASP .Net 0 05-27-2006 05:15 PM



Advertisments