We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Get data row or cell from grid when click on command button

Thread ID:





143425 Mar 20,2019 04:45 AM UTC Mar 20,2019 09:59 AM UTC ASP.NET MVC - EJ 2 1
Tags: Grid
Juan José
Asked On March 20, 2019 04:45 AM UTC

I  have a grid with command in column, and I need to get a cell value from row where button clicked. 
this is my grid 

    List<object> comandos = new List<object>();
    comandos.Add(new { type = "email", buttonOption = new { content = "", cssClass = "e-flat", iconCss = "e-mail e-icons" } });
@Html.EJS().Grid("grdBeneficiarios").DataSource(dataManager => { dataManager.Json(Model.ToArray()).InsertUrl("/Contrato/AgregarBeneficiario").RemoveUrl("/Contrato/EliminarBeneficiario").UpdateUrl("/Contrato/ActualizarBeneficiario").Adaptor("RemoteSaveAdaptor");}).ActionBegin("actionBegin").Columns(col =>
    col.Field("IdTiposIdentificacion").HeaderText("Tipo id").ForeignKeyField("IdTiposIdentificacion").ForeignKeyValue("Nombre").DataSource((List<TipoIdViewModel>)PersonaServices.GetTiposId()).Add();
    col.Field("NumeroId").HeaderText("Numero id").Add();
    col.Field("PrimerNombre").HeaderText("Primer nombre").Visible(false).Add();
    col.Field("SegundoNombre").HeaderText("Segundo nombre").Visible(false).Add();
    col.Field("PrimerApellido").HeaderText("Primer apellido").Visible(false).Add();
    col.Field("SegundoApellido").HeaderText("Segundo apellido").Visible(false).Add();
    col.Field("IdSede").HeaderText("Sede").ForeignKeyField("IdSede").ForeignKeyValue("Nombre").DataSource((List<SedeViewModel>)ContratoServices.GetSedes().FindAll(s => s.Habilitado)).Add();
    col.Field("WelcomeDay").HeaderText("Welcome day").EditType("datetimepickeredit").Add();
    col.HeaderText("Enviar email").Width("160").Commands(comandos).Add();
}).Locale("es-CO").Load("load").EditSettings(edit => { edit.AllowAdding(true).AllowEditing(true).AllowDeleting(true).Mode(Syncfusion.EJ2.Grids.EditMode.Dialog); }).Toolbar(toolbarItems).Render()

    function load(args) {
        this.columns[13].commands[0].buttonOption.click = function (args) {
            var x = correo;
            var gridObj = ej.base.getComponent(document.getElementById("grdBeneficiarios"), ej.grids.Grid);
            ??? how to get the row or better, the cell value in "Email" column ?

Thanks for your help.
Kind regards,
Juan J.

Thavasianand Sankaranarayanan [Syncfusion]
Replied On March 20, 2019 09:59 AM UTC

Hi Juan, 

Greetings from Syncfusion. 

Based on your we suspect that you want to the cell values while we click on the command button. 

We have already discuss about the above mention query in the following documentation. 

Please let us know if you need further assistance on this. 

Thavasianand S. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon