Click here to Skip to main content
15,894,100 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to remove gridview rows in current page but dont effect to database

iwant to maintain imagebutton for delete rows in gridivew how can i maintain that this is my code


ASP.NET
<asp:GridView ID="gvSelected" runat="server"
           onrowdeleting="gvSelected_RowDeleting"   >




C#
private void BindGrid()
    {
        ViewState["hai"] =Session["SelectedRecords"];
        Session.Clear();
        DataTable dt = (DataTable)ViewState["hai"];
        gvSelected.DataSource = dt;
        gvSelected.DataBind();
        
        
  
    }
Posted
Updated 29-Oct-11 1:42am
v3
Comments
hzawary 29-Oct-11 7:22am    
Can you query from your table with condition (WHERE command) in database?
Because by this command you can arrive to your goal.

1 solution

Load into DataTable, remove rows, then bind ...

Best regards
Espen Harlinn
 
Share this answer
 
Comments
DGKumar 29-Oct-11 7:32am    
GoodEvening SIr i have updated my Query please check now..
DGKumar 29-Oct-11 7:39am    
I want to maintain imagebutton for delete rows

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