I have a Grid View. I added AutoGenerateEditButton=True.
AutoGenerateEditButton=True
I want to display that button to users that belong to a certain role. If not the button is not rend
Use ButtonField with CommandName = Edit. You can hide the column in Page_Load function based on the user's role:
ButtonField
CommandName = Edit
Page_Load
const int _editColumnIndex = 0; void Page_Load(object sender, EventArgs e) { if(!User.IsInRole("Manager")) grdMovies.Columns[_editColumnIndex].Visible = false; }