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

Render Command Buttons on a Single Line

2 Answers 147 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Anthony
Top achievements
Rank 1
Anthony asked on 20 Apr 2015, 07:09 PM

How do I prevent the command buttons from wrapping in the command column on each of the grid rows? I want them to render in a straight, horizontal line even if they extend past the edge of the grid.

 like this:

+ ---------------------------------------------------------+
|  column 1 | ... | column n | [btn1] [btn2] [btn3] [btn4] |
+ ---------------------------------------------------------+

instead of:

+ -------------------------------------------+
| column 1 | ... | column n | [btn1] [btn2]  |
|          |     |          | [btn3] [btn4]  |
+ -------------------------------------------+

2 Answers, 1 is accepted

Sort by
0
Anthony
Top achievements
Rank 1
answered on 21 Apr 2015, 07:01 PM
bump
0
Iliana Dyankova
Telerik team
answered on 22 Apr 2015, 02:52 PM
Hi Anthony,

In order to ensure the buttons won't wrap I would suggest to set column width equal to or greater than the sum of all button widths and make the grid scrollable. For example: 
@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.EmployeeViewModel>()   
  .Name("Grid")
  .Columns(columns => {
     columns.Bound(e => e.FirstName).Width(800);
     columns.Bound(e => e.LastName).Width(700);
     columns.Bound(e => e.Title);
     columns.Command(command => {
         command.Custom("ViewDetails");
         command.Custom("ViewDetails");
         command.Custom("ViewDetails");
         command.Custom("ViewDetails");
      }).Width(500);
    })   
  .Scrollable()
  //....
)


Regards,
Iliana Nikolova
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
Grid
Asked by
Anthony
Top achievements
Rank 1
Answers by
Anthony
Top achievements
Rank 1
Iliana Dyankova
Telerik team
Share this question
or