This is a migrated thread and some comments may be shown as answers.

Display text on button and change color of the button

2 Answers 468 Views
Grid
This is a migrated thread and some comments may be shown as answers.
crazy05
Top achievements
Rank 1
crazy05 asked on 15 Jan 2016, 06:29 PM

Hello,

I want to display text on button based on the value from database.

So, button text varies in each row(Ex: In service, Expired, 30 days Expire).

1) How can I display text in button in Kendo row ?

2) I want to change the color of the button based on the above 3 values. (Ex: In Service - Green, Expired - Red, 30 day expire - Yellow)

 I want to display that button in the custom command button in below code

How can I do this ?

@(Html.Kendo().Grid(Model)
           .Name("grid")
           .Columns(columns =>
           {
               columns.Bound(c => c.UserName).Title("User").Filterable(false);               
               columns.Bound(c => c.Role).Title("Role");               
               //columns.Command(command => command.Custom().Click("showDetails"));
           })
           .HtmlAttributes(new { style = "height: 500px;" })
           .Sortable()
           .Scrollable(x => x.Height(400))
           .Filterable()
           .Pageable(x => x.Enabled(true).PreviousNext(false).PageSizes(true))
       )

2 Answers, 1 is accepted

Sort by
0
crazy05
Top achievements
Rank 1
answered on 17 Jan 2016, 05:52 PM
Any help ?
0
Boyan Dimitrov
Telerik team
answered on 19 Jan 2016, 12:08 PM

Hello,

 

In order to achieve the desired functionality please use the dataBound event of the Kendo UI Grid for ASP.NET MVC. I would suggest to take a look at the forum discussion that demonstrates very similar approach in action. 

 

Regards,
Boyan Dimitrov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
crazy05
Top achievements
Rank 1
Answers by
crazy05
Top achievements
Rank 1
Boyan Dimitrov
Telerik team
Share this question
or