Formview fired event itemupdating which wasn

Finally we need to populate the Sort Expression and Sort Direction when they change, and we’ll handle that in the Sorting event. Also like paging, so show that it does get called, databinding is handled in the Sorted Event ( First, we obtain the User ID of the affected row from the Grid View Data Keys collection, which we use to pull the appropriate record from the database.

At that point we need to get the new values so we can update the record, which is done slightly differently for the Bound Field and the Template Field.

- Mark I'm trying to understand how to respond to mode changing events in a Form View control.

We’re using Linq to SQL to pull data from our database and bind it to the Grid View.

For the Bound Field, we don’t know the ID of the Text Box since it’s autogenerated by the Bound Field, so we obtain a reference to it by getting the first control in the appropriate cell in the edited row.

Since it’s a Bound Field, the Text Box is going to be Control[0].

Do I have to call the Change Mode() method in the Mode Changing event handler? I can see the mode in the process of changing, because my Mode Changing handler gets called, but then the Mode Changed handler never gets called.

- Mark Hi Mark, I had a look at the Form View control's code, and it seems Mode Changed event is only raised when formview is bound to a datasource control (i.e. See it for yourself: private void Handle New() Unfortunatelly, you have to handle Mode Changing event and call Change Mode() manually with e.

Leave a Reply