Tengo una vista de cuadrícula con el campo de comando "Editar cancelación de la actualización". Cuando hago clic en Editar, todas las columnas de la fila en particular se pueden editar y cuando hago clic en actualizar, la Tabla se actualiza según los nuevos valores. Luego, el Gridview está enlazado con la tabla de datos actualizada. Pero el botón "Actualizar Cancelar" todavía permanece.Necesito hacer la fila en modo normal después de actualizar
Una vez que la fila, se ha actualizado, la "Actualización Cancelar" tiene que ser cambiado a "Editar" Entonces, ¿cómo es que hizo posible.
Gracias de antemano
Este es el código para la actualización y la visualización de los datos actualizados
protected void StaticNoticeGridView_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
try
{
//Gets the updated value from GridView
string id = StaticNoticeGridView.Rows[e.RowIndex].Cells[0].Text;
string updatedItem = e.NewValues[0].ToString();
string updatedURL = e.NewValues[1].ToString();
//Updated the Database
StaticNoticeController staticNoticeController = new StaticNoticeController();
int rocordsAffected = staticNoticeController.UpdateStaticNoticeData(updatedItem, updatedURL, id);
//Gets the updated datatable and binds the Gridview again
if (rocordsAffected == 1)
{
this.StaticNoticeGridView.DataSource = null;
this.StaticNoticeGridView.DataSource = staticNoticeController.GetStaticNoticeData();
this.StaticNoticeGridView.DataBind();
}
}
catch(SystemException ex)
{
//ToDo: Log the Exception
}
}
favor mostrar el código usted utiliza para el controlador de evento click de actualización. – Hogan
@Hogan Gracias .. El código ha sido agregado a la pregunta. – Ananth