polybius
polybius

Reputation: 21

ASP.NET GridView Horizontal ScrollBar

I´ve seen a lot of similar questions, but none like this, so here's the catch.

I have a AjaxControlToollkit tab, and inside it, i have a GridView. I want that GridView to have a scrollbar, so i can navigate

I can add a scrollbar, but by increasing the width of the GridView (doing this so i could test this spectacular scheme :P), that GridView grows outside the Tab, so all of the page has a scrollbar...

So here's what i want to do:

(I know that this doubt is a little bit strange, but those are my requirements)

Upvotes: 2

Views: 19837

Answers (2)

<div style="overflow-x:auto">
    @Html.Grid(Model.StudentList).Named("StudentsGrid").Columns(c =>
      {
        c.Add(x => x.Name).Titled("Name").Filterable(true).Sortable(true);
        c.Add(x => x.FName).Titled("Father Name").Filterable(true).Sortable(true);
        c.Add(x => x.Class).Titled("Class").Filterable(true).Sortable(true);
        c.Add(x => x.RollNo).Titled("Roll No").Filterable(true).Sortable(true);
 
      }).WithPaging(10).EmptyText("No users found..")
</div>

Upvotes: 0

Arkan
Arkan

Reputation: 41

Simply wrap the GridView with a styled Div like the following

<div style="overflow-x:auto;width:800px">
   GridView here
</div>

Upvotes: 4

Related Questions