|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Dynamic gridview values lost on postbackI 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 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. Show quoteHide quote > 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 >
Conditional True/False output for datalist item
error: can't find control 'mylabel' which expert can finally solve this? WSS document event handler that will use System.web.mail sendmail Disappearing Web Part Trick Center Login Control and Firefox Admin front end generator How to access a server control within a repeater control Using Control.Render() from a page with a MasterPage Dropdownlist SelectedIndexChanged does not fire? |
|||||||||||||||||||||||