Column headers do not horizontally scroll with data. Need to fix so it does.

0 Answers 13 Views
Grid ScrollView
Michael
Top achievements
Rank 1
Michael asked on 23 Jun 2021, 08:39 PM

The column headers are not horizontally scrolling with the data and I need to fix it so it does. This is what I have to capture data from a .NET data table:

 

@if (Model != null)
{
 
    @(Html.Kendo().Grid(Model)
                .Name("Grid")
                .Columns(columns =>
                {
                    foreach (System.Data.DataColumn column in Model.Columns)
                    {
                        var c = columns.Bound(column.ColumnName);
                        if(column.ColumnName.Equals("Quarter"))
                        {
                            c.Width(100);
                        }
                        else
                        {
                            c.Width(100);
                        }
                    }
                })
                .Pageable()
                .Sortable()
                .Filterable()
                .Scrollable()
                //.Groupable()
                .DataSource(dataSource => dataSource
                    .Ajax()
                 .Model(model =>
                 {
                     //var id = Model.PrimaryKey[0].ColumnName;
                     foreach (System.Data.DataColumn column in Model.Columns)
                     {
                         var field = model.Field(column.ColumnName, column.DataType);
                         field.Editable(false);


                     }
                 })
                 //.Read(read => read.Action("Read", "QuickQuery"))
                 )
        )
Mihaela
Telerik team
commented on 28 Jun 2021, 01:20 PM

Thank you for the provided code snippet.

Would you please share a screenshot that illustrates the behavior you are experiencing to better understand the issue at your end? Also, if any CSS styles are applied to the grid please share them as well.

In addition, if you would like to configure the grid with a horizontal scrollbar check out the forum thread below:

https://www.telerik.com/forums/how-to-configured-scroll-bar-only-horizontally-for-kendo-ui-treelist

 

 

 

No answers yet. Maybe you can help?

Tags
Grid ScrollView
Asked by
Michael
Top achievements
Rank 1
Share this question
or