Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gridview Row Editing Need to lock sorting to not be allowed while in Edit mode

I discovered that when a ROW in my ASP.NET gridview is in Edit mode and I click on column sorting, that now I am actually editing something else.

  1. The business team doesn't want me to simply cancel the edit on a sort
  2. The 1 option is to force a lock on not Being able to SORT while in Edit mode
  3. Or on the Sort that the Edit mode changes to the appropriate row that WAS in the edit mode before the grid sort.

There are only like a dozen rows, so it is not like having to think and worry about paging on this Grid.

Either #2 or #3 are my choices but I don't see any feasible solutions so far.


1 Answers

On a Gridview that has many columns, it can be a bit of an issue to change the SortExpression one at a time. What I've done, in the Gridview1_RowEditing function is:

Gridview1.AllowSorting = false;

Then I set this back to true when the editing is completed or canceled.

like image 127
Mack Avatar answered Nov 26 '25 10:11

Mack