Click here to Skip to main content
15,896,269 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created a grid view and enabled editing, inserting , deleting. How to make these options available on to selected columns (i.e) in a database where information is stored by more than a single user, When he /she logs in , should be able to edit only their records and not other records in the grid view?
Posted

You must have save Id of Users so if Current User Id Matches the Id(say CreatedBy) of that row then Enable Button
It's not necessary to Compare this every time you can save UserId in session while user Log in and then send this id to database so....
there are many ways....
First try to do it yourself and if You stuck somewhere then we are here for Help
Hope This Helps
--Happy Coding
 
Share this answer
 
For that you must have some Relationship in terms of Foreign Key to that table from the User table.

Then while binding the GridView, you can check the Current User against that fetched Foreign Key column and if it matches, then the options will be available, else not.

So, the rows Referenced by the Current User will only be available for Editing, Inserting and Deleting.
 
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