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.
Unfortunately, activation email could not send to your email. Please try again.

Adding a button in dynamic templated column (depending on each row)

Thread ID:

Created:

Updated:

Platform:

Replies:

120819 Oct 19,2015 03:07 AM Oct 22,2015 06:17 AM ASP.NET MVC 3
loading
Tags: Grid
iswariya
Asked On October 19, 2015 03:07 AM

Hi,

  I want to customize add button in grid for each row.

Saravanan Arunachalam [Syncfusion]
Replied On October 20, 2015 02:17 AM

Hi Iswariya,

We analyzed your reported query and we suggest you to use Custom Command Column of Grid to customize the button in each row of Grid. Please refer to the following online sample link:

http://mvc.syncfusion.com/demos/web/grid/customcommand

We can also achieved your requirement using Template column property of Grid. Please refer to the following code example

@(Html.EJ().Grid<EmployeeView>("ColumnTemplate")

       

         . . .

        .ClientSideEvents(eve => {eve.TemplateRefresh("RefreshTemplate");})

        .Columns(col =>

        {

            . . .

            col.HeaderText("Details").Template("<input type = 'button' value ='Details'></input>").TextAlign(TextAlign.Center).Width(110).Add();           

        })

        )

<script type="text/javascript">

            function RefreshTemplate(args) {

                $(args.cell).find("input").ejButton({

                    click: function (e) {

                        alert("Details of the Row")

                    }

                })

            }

</script>

 

And also please refer to the following online documents.  

Online documents for Custom Command:

http://help.syncfusion.com/js/api/ejgrid#members:columns-commands

http://www.syncfusion.com/kb/aspnetmvc/grid?sortId=0&tags=commandbutton

http://www.syncfusion.com/kb/aspnet/grid?sortId=0&tags=commandbutton

http://www.syncfusion.com/kb/javascript/ejgrid?sortId=0&tags=command-column

Online documents for Template Column:

http://help.syncfusion.com/js/api/ejgrid#members:columns-template

http://help.syncfusion.com/js/api/ejgrid#members:columns-templateid

http://www.syncfusion.com/kb/aspnetmvc/grid?sortId=0&tags=templatecolumn

http://www.syncfusion.com/kb/aspnet/grid?sortId=0&tags=templatecolumn

Regards,

Saravanan A.


iswariya
Replied On October 21, 2015 01:59 AM

Thank you...




Saravanan Arunachalam [Syncfusion]
Replied On October 22, 2015 06:17 AM

Hi Iswariya,

Thanks for your update.          

We are happy that the provided information helped you.

Regards,

Saravanan A.


CONFIRMATION

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.

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.

;