Click here to Skip to main content
15,906,218 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Hi frnds,

How to work with multiple edit buttons in gridview, so user can edit left columns with left edit button, and right columns with right edit button in gridview.

Please help

thank you.
Posted
Comments
Sunasara Imdadhusen 3-Jun-13 3:49am    
Not clear!!

1 solution

Set the ReadOnly="true" property on all that you don't want editable.
Refer: BoundField.ReadOnly Property[^]
C#
<columns>
    <asp:boundfield datafield="LoginName" headertext="Login Name" readonly="True" xmlns:asp="#unknown" />
    <asp:boundfield datafield="FirstName" headertext="First Name" readonly="True" xmlns:asp="#unknown" />
    <asp:boundfield datafield="LastName" headertext="Last Name" readonly="True" xmlns:asp="#unknown" />
    <asp:boundfield datafield="UserType" headertext="User Type" readonly="True" xmlns:asp="#unknown" />
    <asp:boundfield datafield="EmailAddress" headertext="EmailAddress" xmlns:asp="#unknown" />
</columns>


Just set the ReadOnly option to true on the columns you DON'T want people to edit. The columns that don't have this set or have ReadOnly set to false are editable by the user when in edit mode.
 
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