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

Gridbuilder Scrollbar Functionality

1 Answer 53 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 18 May 2016, 12:08 AM

Hello, I'm trying to figure out the scrollbar functionality in Gridbuilder. In my particular case, as shown in the code below, I have a toolbar and some columns. The scrollbar is scrolling the entire grid, header and all. There appears to be another scroll bar for just the data but it is greyed out. What I'm trying to do is just get the data to scroll while leaving the header stationary. Any ideas? 

 

    .Name("Generic")
    .Columns(columns =>
    {
        columns.Bound(p => p.Name);
        columns.Bound(p => p.Desc);
    })
    .DataSource(dataSource => dataSource
        .Ajax()
        .Model(model =>
        {
            model.Id(p => p.ID);
        })
        .Create(create => create.Action("Create")
        .Read(read => read.Action("Read")
        .Update(update => update.Action("Update")
        .Destroy(destroy => destroy.Action("Delete")
        .PageSize(20)
    )
    .Sortable(sortable => sortable
        .AllowUnsort(true)
        .SortMode(GridSortMode.SingleColumn))
    .ToolBar(toolbar =>
    {
        toolbar.Template(@<text>
        @item.CreateButton("Add")
        @item.SaveButton("Save", "Cancel")
        </text>);
    })
)

1 Answer, 1 is accepted

Sort by
0
Scott
Top achievements
Rank 1
answered on 18 May 2016, 11:35 PM

Actually, I figured it out already. I was missing the following code which sets the height of the grid:

.HtmlAttributes(new { style = "height: 29em;" })

Tags
Grid
Asked by
Scott
Top achievements
Rank 1
Answers by
Scott
Top achievements
Rank 1
Share this question
or