Click here to Skip to main content
16,004,833 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hey there,

I have a Gridview which is loaded on page load.It includes row editing,updating,deleting and adding new row to the grid.Now i want the grid to show editing features for some defined logins only otherwise it should provide with simple grid with no modifications possible.

How should i do that?.
Do i have to create a new form?..

Thanks
Amit
Posted

Try something like this.


if (LoggedInUser.HasRights())
{
    this.SimpleGridView.ShowFooter = false;
    this.SimpleGridView.AutoGenerateEditButton = false;
    this.SimpleGridView.AutoGenerateDeleteButton = false;
}


You could just hide the edit column.
Hope this helps.
 
Share this answer
 
Comments
AmitChoudhary10 17-Sep-10 6:03am    
Could you help me with some quick tutorial on using asp.net login controls...
Bardy85 17-Sep-10 7:06am    
Steps are fairly simple.

Drag drop Login control, double click LogginIn event.
protected void Login1_LoggingIn(object sender, LoginCancelEventArgs e)
    {
        string usernname = this.Login1.UserName;
        string password = this.Login1.Password;

        //Query database and check if username and password exists 
        //if they don't exits set e.Cancel = true;
    }


Hope this helps.
look at this detail view Login Control in ASP.NET []
 
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