DataGrid must be Bound before Editing

G

Guest

I have a sub named Bind("") which binds my a datagrid on my webform. In
order to enter edit mode and edit records on this datagrid, I must make a
call to Bind("") either before or after I place the DataGrid into edit mode.
For example, DataGrid.EditCommand looks like this ...

DataGrid1.EditItemIndex = e.Item.ItemIndex
Bind("")

Without having the Bind("") call within the EditCommand, an exception occurs
saying something to the extent of..."Failed to enable viewstate...".

The problem with including a call to Bind("") within the EditCommand is that
if there is a sort applied to my datagrid at the time the user enters 'Edit'
mode, the datagrid removes the sort, applying the original sort that it
possesses at load time, and the incorrect record is placed in EDIT mode. How
can I work around this?

Thanks.
 
E

Elton Wang

Hi Mr. Mike,

Yesterday, somebody asked similar question in group
dotnet.framework.aspnet.datagrid, Subject: DataGrid sort
when Editing, you can read the Q & A. If you think the
answer is not you want, please let us know.

HTH

Elton Wang
(e-mail address removed)
 

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

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top