Advertisement
Guest User

Untitled

a guest
Mar 31st, 2015
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. @(Html.Kendo().Grid<ContactViewModel>()
  2. .Name("Grid")
  3. .Columns(columns =>
  4. {
  5. columns.Bound(m => m.NameSurname).Title("Name Surname").Width("%100");
  6. columns.Bound(m => m.InstituteName).Title("Institute Name").Width("250px");
  7. columns.Bound(m => m.CityName).Title("City").Width("145px");
  8. columns.Bound(m => m.RegionName).Title("Region").Width("145px");
  9. columns.Bound(m => m.ContactMobile).Title("Mobile").Width("125px");
  10. columns.Bound(m => m.ContactAddress).Title("Address").Hidden(true); //I want to export these fields
  11. columns.Bound(m => m.ContactAddress).Title("Address").Visible(false); //I want to export these fields
  12. })
  13. .ToolBar(toolbar =>
  14. {
  15. toolbar.Template(@<text>
  16. <div class="toolbar">
  17. <button class="btn btn-primary btn-xs pull-right k-button k-button-icontext k-grid-excel">
  18. <span class="k-icon k-excel"></span>
  19. Liste (xls)
  20. </button>
  21. </div>
  22. </text>);
  23. })
  24.  
  25. .Excel(excel => excel
  26. .FileName("List.xlsx")
  27. .Filterable(true)
  28. .AllPages(true)
  29. .ProxyURL(Url.Action("Excel_Export_Save", "Controller"))
  30. )
  31. .DataSource(dataSource => dataSource
  32. .Ajax()
  33. .Read(read => read.Action("Index_Read", "Controller"))
  34. .ServerOperation(false)
  35. .PageSize(12)
  36. )
  37. )
  38. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement