Error When Editing DataGrid

G

Guest

Hi. In order to successfully Edit a record in my datagrid I must first call
the " DataGrid1.EditItemIndex = e.Item.ItemIndex" command and THEN call the
SUB that binds my datagrid. If I only call "DataGrid1.EditItemIndex =
e.Item.ItemIndex" without subsequently binding my datagrid I get the
following error...

Failed to load viewstate. The control tree into which viewstate is being
loaded must match the control tree that was used to save viewstate during the
previous request. For example, when adding controls dynamically, the controls
added during a post-back must match the type and position of the controls
added during the initial request.

Why do I need to call the sub that binds my datagrid in order to edit the
datagrid? Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,169
Latest member
ArturoOlne
Top