C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » ASP.NET GridView »

To get the repeater item on button click in repeater and delete row from table ion c#


Posted Date: 14 Nov 2008    Resource Type: Code Snippets    Category: ASP.NET GridView
Author: Naresh ThakurMember Level: Bronze    
Rating: 1 out of 5Points: 5



This sample code snippet shows how to get the repeater item on button click in repeater and delete row from table ion c#.


//To detect the Repeater item on button click clicked on

ImageButton close = (ImageButton)sender;
RepeaterItem gvRow = (RepeaterItem)close.NamingContainer;
String URL = ((HtmlInputHidden)gvRow.FindControl("Text1")).Value;

//To delete row from table in c# if datakey is equal to the column value in table


DataSet ds_cart = (DataSet)(Session["TempCart"]);
String[] arr = e.CommandArgument.ToString().Split(',');
foreach (DataRow row in ds_cart.Tables[0].Rows)
{
if (row["OrderID"].ToString() == arr[0].ToString())
{
row.Delete();
break;
}

}



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Repeater Item on button click  .  Naming Container  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Working with XML in a Datagrid and LoginPage
Previous Resource: Implement custom paging in datagrid
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET GridView


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use