Click here to Skip to main content
15,912,493 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am using one radgrid with edit delete buttons ,but i want the same grid for both the users,user and admin,for admin i want to enable edit and delete, for the user without edit, delete button whenever they are login with their username, the same grid for both ,user and admin.how can i differentiate please help me .thank you.
Posted

1 solution

Hi,
You can check login and set the buttons column visible if user is admin.
Here you go:
C#
protected void Page_Load(object sender, EventArgs e)
{
    if(!IsPostBack)
    {
        if(Session["UserType"] != "Admin")
        {
            gvTitle.Columns[colIndex].Visible = false;
            // colIndex is the index of your edit and delete button column.
        }
    }
}



--Amit
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900