Coder Social home page Coder Social logo

lanadx / aspxgridview-how-to-update-an-external-control-during-a-callback-e2379 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from devexpress-examples/asp-net-web-forms-update-an-external-control-on-a-callback

0.0 0.0 0.0 410 KB

.NET, ASP.NET Web Forms, ASPxGridView

License: Other

C# 13.51% ASP.NET 86.49%

aspxgridview-how-to-update-an-external-control-during-a-callback-e2379's Introduction

GridView for Web Forms - How to update an external control during a callback

[Run Online]

A control can update only its own rendering in a callback. This example shows how to update the ASPxLabel control when a callback of the ASPxGridView control is finished.

Label updated on grid callback

ASPxGridView sends callbacks to update row data on the server. The control raises the EndCallback client event after a callback is successfully executed. You can handle the event to perform custom actions with another control when the callback is finished.

<dx:ASPxGridView ...>
    <ClientSideEvents EndCallback="OnEndCallBack" />
</dx:ASPxGridView>

ASPxGridView implements the JSProperties property that allows you to pass information from the server to the client. In this example, an updated row’s key is saved to the JSProperties property on the server. This value is then used on the client to display information about the updated row.

protected void Page_Load(object sender, EventArgs e) {
    ASPxGridView1.JSProperties["cpIsUpdated"] = "";
}
protected void ASPxGridView1_RowUpdated(object sender, DevExpress.Web.Data.ASPxDataUpdatedEventArgs e) {
    if (e.Exception == null) {
        ((ASPxGridView)sender).JSProperties["cpIsUpdated"] = e.Keys[0];
    }
}
function OnEndCallBack(s, e) {
    if (s.cpIsUpdated != '') {
        clientLabel.SetText('Category ' + s.cpIsUpdated + ' is updated successfully');
    }
    else {
        clientLabel.SetText('');
    }
}

Files to Look At

Documentation

aspxgridview-how-to-update-an-external-control-during-a-callback-e2379's People

Contributors

devexpressexamplebot avatar lanadx avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.