This is a migrated thread and some comments may be shown as answers.

Hide edit link after performing update

1 Answer 48 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Zash
Top achievements
Rank 1
Zash asked on 02 Feb 2011, 11:39 PM
I need to hide edit link after clicking update for a row in grid.
Can this be done?

 

if (e.CommandName == "Update")

 

{

GridEditableItem editedItem = (e.Item as GridEditableItem);
/* do something here*/

 

editedItem.Visible =

false; //not working

 

editedItem.Edit =

false; // not working

 

 

}


Thanks

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 03 Feb 2011, 06:37 AM
Hello Zash,

I guess you want to hide the edit button for all updated row. If so you can do the following to achieve this

  •         When a row is updated checked, store the key values for the updated row in a Session variable.
  •           Add a PreRender event handler to the grid.
  •           In the pre-render event of the grid, traverse the rows of the grid and compare their key values to the values saved in the Session variable. Whenever you find a match, access the editbutton for that row and hide it.
You can refer the following documentation which explains how to persist the selected rows server-side on sorting/paging/filtering/grouping. Use the same logic and make necessary modification.

Persisting the selected rows server-side on sorting/paging/filtering/grouping

Hope this information helps,
Princy.
Tags
Grid
Asked by
Zash
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or