EditIndex after Sorting a gridview
-
hi i have a manually binded GridView with sorting and editing enabled. my problem is with editing columns after sorting them, as the newEditIndex property in the GridView RowEditing event is a reflection of the data from the db and not the dataview that have been set on the gridview Sorting event, the outcome is that when pressing the edit button on a row after sorting, a different row in getting in to edit mode. if any one know the solution please in light me...:} tnx j
-
hi i have a manually binded GridView with sorting and editing enabled. my problem is with editing columns after sorting them, as the newEditIndex property in the GridView RowEditing event is a reflection of the data from the db and not the dataview that have been set on the gridview Sorting event, the outcome is that when pressing the edit button on a row after sorting, a different row in getting in to edit mode. if any one know the solution please in light me...:} tnx j
In the sorting event you could set the editindex = -1 and then let the edit button do it's thing. Use the OnRowEditing even and some similar code in that function possibly? GridView grdView = sender as GridView; grdView.EditIndex = e.NewEditIndex; //Rebind grid here...
Revolutionary: Disk drives go round and round.
-
In the sorting event you could set the editindex = -1 and then let the edit button do it's thing. Use the OnRowEditing even and some similar code in that function possibly? GridView grdView = sender as GridView; grdView.EditIndex = e.NewEditIndex; //Rebind grid here...
Revolutionary: Disk drives go round and round.
i think that as long you are not in edit mode the editIndex will always will be -1? I've solved it by saving the sorting definitions (the expression and direction) in a Session object and retrieved the data with an "ORDER BY" clause giving it these parameters... thanks j
-
i think that as long you are not in edit mode the editIndex will always will be -1? I've solved it by saving the sorting definitions (the expression and direction) in a Session object and retrieved the data with an "ORDER BY" clause giving it these parameters... thanks j
Yes, sorry. I misread the question. Glad you got it worked out!
Revolutionary: Disk drives go round and round.