Facebook
From Beige Teal, 3 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 70
  1. <div id="data-grid-demo">
  2.     @(Html.DevExtreme().DataGrid<Insurance.ViewModels.BrandViewModel>()
  3.         .ID("gridContainer")
  4.         .ShowBorders(true)
  5.         .Paging(p => p.Enabled(false))
  6.         .Editing(e => e.Mode(GridEditMode.Popup)
  7.             .AllowUpdating(true)
  8.             .Popup(p => p
  9.                 .Title("Employee Info")
  10.                 .ShowTitle(true)
  11.                 .Width(700)
  12.                 .Height(525)
  13.                 .Position(pos => pos
  14.                     .My(HorizontalAlignment.Center, VerticalAlignment.Top)
  15.                     .At(HorizontalAlignment.Center, VerticalAlignment.Top)
  16.                     .Of(new JS("window"))
  17.                 )
  18.             )
  19.             .Form(f => f.Items(items => {
  20.                 items.AddGroup()
  21.                     .ColCount(2)
  22.                     .ColSpan(2)
  23.                     .Items(groupItems => {
  24.                         groupItems.AddSimpleFor(m => m.BrandName);
  25.                        
  26.  
  27.                         groupItems.AddSimpleFor(m => m.BrandName)
  28.                             .ColSpan(2)
  29.                             .Editor(editor => editor.TextArea().Height(100));
  30.                     });
  31.  
  32.                
  33.             }))
  34.         )
  35.         .Columns(columns => {
  36.             columns.AddFor(m => m.BrandName)
  37.                 .Width(70);
  38.  
  39.            
  40.         })
  41.         .DataSource(d => d.Mvc()
  42.             .Controller("DataGridEmployees")
  43.             .LoadAction("Get")
  44.             .UpdateAction("Put")
  45.             .Key("ID")
  46.         )
  47.         .DataSourceOptions(d => d.Filter("['ID', '<=' , 14]"))
  48.     )
  49. </div>