|
Este artigo foi traduzido por máquina. Coloque o ponteiro do mouse sobre as frases do artigo para ver o texto original. Mais informações.
|
Tradução
Original
|
GridViewCancelEditEventHandler Representante
Assembly: System.Web (em System.Web. dll)
public delegate void GridViewCancelEditEventHandler( Object sender, GridViewCancelEditEventArgs e )
Parâmetros
- sender
- Tipo: System.Object
A origem do evento.
- e
- Tipo: System.Web.UI.WebControls.GridViewCancelEditEventArgs
A GridViewCancelEditEventArgs object that contains the event data.
<%@ Page language= %>
<!DOCTYPE html PUBLIC "-
"http:
<script runat=>
Page_Load(Object sender, EventArgs e)
{
GridView customerGridView = GridView();
customerGridView.ID = ;
customerGridView.DataSourceID = ;
customerGridView.AutoGenerateColumns = ;
customerGridView.AutoGenerateEditButton = ;
customerGridView.DataKeyNames = String[] { };
customerGridView.RowCancelingEdit += GridViewCancelEditEventHandler(.CustomersGridView_RowCancelingEdit);
customerGridView.RowUpdated += GridViewUpdatedEventHandler(.CustomersGridView_RowUpdated);
GridViewPlaceHolder.Controls.Add(customerGridView);
}
CustomersGridView_RowCancelingEdit(Object sender, GridViewCancelEditEventArgs e)
{
Message.Text = + e.RowIndex.ToString() + ;
}
CustomersGridView_RowUpdated(Object sender, GridViewUpdatedEventArgs e)
{
Message.Text = ;
}
</script>
<html xmlns="http:
<head runat=>
<title>GridViewCancelEditEventHandler Example</title>
</head>
<body>
<form id= runat=>
<h3>GridViewCancelEditEventHandler Example</h3>
<asp:label id=
forecolor=
runat=/>
<br/>
<asp:placeholder id=
runat=/>
<!-- This example uses Microsoft SQL Server and connects -->
<!-- to the Northwind sample database. Use an ASP.NET -->
<!-- expression to retrieve the connection string value -->
<!-- the Web.config file. -->
<asp:sqldatasource id=
selectcommand=
updatecommand=
connectionstring=
runat=>
</asp:sqldatasource>
</form>
</body>
</html>
<%@ Page language= %>
<!DOCTYPE html PUBLIC "-
"http:
<script runat=>
CustomersGridView_RowCancelingEdit(Object sender, GridViewCancelEditEventArgs e)
{
GridViewRow row = CustomersGridView.Rows[e.RowIndex];
Message.Text = + row.Cells[1].Text + ;
}
CustomersGridView_RowEditing(Object sender, GridViewEditEventArgs e)
{
Message.Text = ;
}
CustomersGridView_RowUpdated(Object sender, GridViewUpdatedEventArgs e)
{
Message.Text = ;
}
</script>
<html xmlns="http:
<head runat=>
<title>GridView RowCancelingEdit Example</title>
</head>
<body>
<form id= runat=>
<h3>GridView RowCancelingEdit Example</h3>
<asp:label id=
forecolor=
runat=/>
<br/>
<!-- The GridView control automatically sets the columns -->
<!-- specified the datakeynames attribute read-only. -->
<!-- No input controls are rendered these columns -->
<!-- edit mode. -->
<asp:gridview id=
datasourceid=
autogeneratecolumns=
autogenerateeditbutton=
allowpaging=
datakeynames=
onrowcancelingedit=
onrowediting=
onrowupdated=
runat=>
</asp:gridview>
<!-- This example uses Microsoft SQL Server and connects -->
<!-- to the Northwind sample database. Use an ASP.NET -->
<!-- expression to retrieve the connection string value -->
<!-- the Web.config file. -->
<asp:sqldatasource id=
selectcommand=
updatecommand=
connectionstring=
runat=>
</asp:sqldatasource>
</form>
</body>
</html>