Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Gridview scroll bar

Posted on 2012-04-09
2
Medium Priority
?
478 Views
Last Modified: 2012-04-10
Hello, I have a gridview that has a scroll. When the table has a lot of records. It helps me.
However sometimes the gridview is empty. It also display the scroll. It is ugly.
How to remove it?
I mean dynamically control the scroll.
#gridview
{
    float: right;
    overflow: scroll;
    width: 675px;
}

Open in new window

<div id="gridview">
                <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" BorderColor="YellowGreen"
                    DataSourceID="SqlDataSource1" AutoGenerateColumns="False" DataKeyNames="ProbId"
                    PageSize="30" AutoGenerateEditButton="True" AutoGenerateDeleteButton="True" Visible="true">

Open in new window

0
Comment
Question by:zhshqzyc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 20

Accepted Solution

by:
BuggyCoder earned 2000 total points
ID: 37825270
here is a simple suggestion, put your gridview in asp:panel control and display scrollbars.
At the time of Datbinding see if your datasource has data then add scrolling to panel otherwise remove the scroll.
pnlTest.ScrollBars = ScrollBars.Vertical;
pnlTest.ScrollBars = ScrollBars.None;

Open in new window

0
 
LVL 5

Expert Comment

by:Vishal Kedar
ID: 37826425
try below code

#gridview
{
    float: right;
    overflow: scroll;
    width: 675px;
    height:400px      //whatever height you want.
}

it may helps.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question