Click here to Skip to main content
15,878,543 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have binded gridview from code behind also I have generated Row Editing event. But dont want grid view edit mode on Row Editing event

What I have tried:

I have tried giving editindex = -1
Updated 20-Mar-18 3:34am
Vincent Maverick Durano 20-Mar-18 23:21pm    
It doesn't make sense to me. Why would you use the RowEditing event if you aren't gonna allow users to put them on edit state?

Perhaps you could expound more on how you are trying to achieve and rethink your approach.

1 solution

If you don't want the user to be able to edit a row, then it doesn't make any sense to have an "Edit" button.

But, if you want to cancel the edit, you just need to set e.Cancel = true:
protected void GridView_RowEditing(object sender, GridViewEditEventArgs e)
    e.Cancel = true;
Share this answer
dkamble 10358990 21-Mar-18 0:39am    
thank u , I will try

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