css - 如何在 Syncfusion 响应式 MVC 网格中启用滚动

标签 css asp.net-mvc responsive-design responsive syncfusion

我在 MVC 应用程序中使用 Syncfusion 创建了一个网格,并通过导入 ej.grid.responsive.css 使其响应。但是当它以移动分辨率呈现时,滚动条不可见,并且由于不显示滚动条,我无法看到其他列。 我如何在 Syncfusion MVC Grid 中启用该滚动条?

<div class="box-body">
   @(Html.EJ().Grid<ServiceRepairInspectionViewModel>("SriGrid")
      .Datasource(ds => ds.URL(@Url.Action("GetActive", "ServiceRepairInspection")).Adaptor(AdaptorType.UrlAdaptor))
                      .AllowPaging()
                      .IsResponsive(true)
                      .EnableResponsiveRow(true)
                      .AllowScrolling(true)
                      .ScrollSettings(scroll => {                           scroll.EnableTouchScroll(true); })
                      .Columns(col =>
                      {
                          col.Field(p => p.Id).Visible(false).IsPrimaryKey(true).Add();
                          col.Field(p => p.SriName).HeaderText("Id").AllowFiltering(true).Add();
                          col.Field(p => p.CustomerFirstName).HeaderText("Name").AllowFiltering(true).FilterType(FilterOption.Menu).Add();
                          col.Field(p => p.JobDescription).HeaderText("Job Description ").ForeignKeyField("Value").ForeignKeyValue("Text").DataSource(EnumHelper.GetSelectList(typeof (EnumJobDescription))).AllowSorting(true).Add();
                          col.Field(p => p.Status).HeaderText("Status").Template("#statusTemplate").AllowSorting(true).Add();

                      }))
            </div>

注意:当我以移动分辨率渲染该窗口时,Gird 正在滚动,但只有滚动条未显示。

最佳答案

我们发现您没有在网格中设置 MinWidth 属性。要在响应时在网格中显示滚动条,我们建议您在网格中设置 MinWidth 属性。

请引用下面的代码示例。

[Index.cshtml]

    @(Html.EJ().Grid<MvcApplication14.OrdersView>("FlatGrid")
        .Datasource((IEnumerable<object>)ViewBag.dataSource)
      .AllowPaging()
                          .IsResponsive(true)

                          .MinWidth(400)
                          ...
    .Columns(col =>
    {
             ...
    })
    )

请引用文档链接:

链接:https://help.syncfusion.com/api/js/ejgrid#members:minwidth

关于css - 如何在 Syncfusion 响应式 MVC 网格中启用滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41518522/

相关文章:

c# - 无法将类型 'System.Collections.Generic.List<MODEL#1>' 隐式转换为 'System.Collections.Generic.List<Model#2>

c# - 在asp.net mvc View 中创建viewModel对象

c# - Linq to CSV : Convert data to . CSV 文件并从操作返回文件而不在服务器上保存文件

css - 调整浏览器大小时显示右边距

html - CSS 宽度对不同的屏幕有何 react ?

jquery - 滚动上闪烁的 jquery div?

html - 顶部和底部带有部分边框的按钮

html - css链选择器

javascript - 获取子元素的父 DOM 元素

html - 使用 bootstrap 3 响应式登录