954,595 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

deleting values from the gridview

i have created the code like this

<asp:GridView ID="grd" runat="server" AutoGenerateColumns="False" 
 onselectedindexchanged="grd_SelectedIndexChanged"        Width="100%">
  <Columns>
         <asp:BoundField DataField="ID" HeaderText="Budget ID" />

 <asp:CommandField HeaderText="Delete" ShowDeleteButton="True" />
    </Columns>
  </asp:GridView>


a show delete field will appeat at run time.
i want to delete the row from the gridview.can anybody tell me how to do it?when i will click on the delete field at the execution time.

kapil.tandon
Newbie Poster
23 posts since Oct 2008
Reputation Points: 10
Solved Threads: 0
 

why not just delete the row from your datasource and reload the grid?

dickersonka
Veteran Poster
1,175 posts since Aug 2008
Reputation Points: 130
Solved Threads: 143
 

i have created the code like this

<asp:GridView ID="grd" runat="server" AutoGenerateColumns="False" 
 onselectedindexchanged="grd_SelectedIndexChanged"        Width="100%">
  <Columns>
         <asp:BoundField DataField="ID" HeaderText="Budget ID" />

 <asp:CommandField HeaderText="Delete" ShowDeleteButton="True" />
    </Columns>
  </asp:GridView>

a show delete field will appeat at run time. i want to delete the row from the gridview.can anybody tell me how to do it?when i will click on the delete field at the execution time.

Do you only want to delete the row from the GridView and not from the DataBase?

binoj_daniel
Practically a Master Poster
645 posts since Dec 2006
Reputation Points: 25
Solved Threads: 18
 

HI...
It will work do like this.. ...

sekharM
Newbie Poster
1 post since Dec 2009
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You