Click here to Skip to main content
15,893,161 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all,

I have this question that is really confusing me......I have got one editable gridview with edit, update and cancel properties. Now when I am calling the gridview function in pageload like following, it works fine..

C#
protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            bindcon();  //gridview
        }
    }


but what I need is to show the gridview in editable mode on button click...so I am calling the function inside click event.....but then the edit or update or cancel are not working properly....can anyone explain why??

C#
protected void btn_Click(object sender, EventArgs e)
    {
        lblnmorg.Text = "ABC";
        orgnm = "ABC";
        bindcon();   //gridview
    }


this isnt working...
Posted
Comments
Member 10457105 12-Dec-13 3:42am    
grid view have some events row_editiong.row_deleting. row_cancelling use that events to editable gridview.. Go to properties of gridview. click on event(symbol) u ll see row editing.RowUpadating. row canceling... use that..
planetz 12-Dec-13 6:01am    
yes i have used them already...but they are for editing operations....am talking about displaying gridview in editable mode on clicking button....
Tom Marvolo Riddle 12-Dec-13 4:42am    
post your complete code.
TrushnaK 12-Dec-13 5:05am    
use gridview events for insert,update,delete.
like row_editing,row_cancelling etc...

Hi You can not bind twice.
Please delete bindcon() on button click event.
Yours Farhad.
 
Share this answer
 
Comments
planetz 12-Dec-13 6:00am    
i didnt bind it twice...they are two different cases...one works...one doesnt...
nothing just go in the property of readonly false gridview is in editable mode

and if you want to make some field readonly then also you can do


its easy task
 
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