How to avoid horizontal Scroll bar in DIV Tag

Discussion in 'ASP .Net Web Controls' started by nityaprakash@gmail.com, Sep 14, 2008.

  1. Guest

    Hi,

    I am displaying asp.net datagrid in DIV tag. I have specified
    following css to DIV.


    ..divBox
    {
    border:solid 1px black;
    min-width : 150px
    max-height : 150px;
    background-color : Silver;
    position:absolute;
    overflow-y:auto;



    }


    It is working fine if width of grid is greater than min-width. But
    when height is greater than instead of only verticle scroll bar, both
    scrollbars are being displayed.

    How can horizontal scroll bar can be avoid.


    Help is highly appriciated.


    -Nitya
     
    , Sep 14, 2008
    #1
    1. Advertising

  2. Hi Nitya,

    If my understanding is correct you want to hide the horizontal scrollbar.
    If so you can try to use this css:

    .divBox
    {
    border:solid 1px black;
    min-width : 150px;
    max-height : 150px;
    background-color : Silver;
    position:absolute;
    overflow-y:auto;
    overflow-x:hidden;

    }

    By adding overflow-x:hidden we can hide it.

    Regards,
    Allen Chen
    Microsoft Online Support

    Delighting our customers is our #1 priority. We welcome your comments and
    suggestions about how we can improve the support we provide to you. Please
    feel free to let my manager know what you think of the level of service
    provided. You can send feedback directly to my manager at:
    .

    ==================================================
    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://support.microsoft.com/select/default.aspx?target=assistance&ln=en-us.
    ==================================================
    This posting is provided "AS IS" with no warranties, and confers no rights.


    --------------------
    | From:
    | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    | Subject: How to avoid horizontal Scroll bar in DIV Tag
    | Date: Sun, 14 Sep 2008 12:11:02 -0700 (PDT)
    | Organization: http://groups.google.com
    | Lines: 33
    | Message-ID:
    <>
    | NNTP-Posting-Host: 24.98.39.216
    | Mime-Version: 1.0
    | Content-Type: text/plain; charset=ISO-8859-1
    | Content-Transfer-Encoding: 7bit
    | X-Trace: posting.google.com 1221419462 6795 127.0.0.1 (14 Sep 2008
    19:11:02 GMT)
    | X-Complaints-To:
    | NNTP-Posting-Date: Sun, 14 Sep 2008 19:11:02 +0000 (UTC)
    | Complaints-To:
    | Injection-Info: l42g2000hsc.googlegroups.com; posting-host=24.98.39.216;
    | posting-account=fD2ORAoAAAAGefbHaC0xVzCgut6QGYbO
    | User-Agent: G2/1.0
    | X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1;
    | Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ;
    .NET
    | CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.2),gzip(gfe),gzip(gfe)
    | Path:
    TK2MSFTNGHUB02.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTFEEDS01.phx.gbl!newsfeed0
    0.sul.t-online.de!t-online.de!tiscali!newsfeed1.ip.tiscali.net!proxad.net!fe
    eder1-2.proxad.net!64.233.178.134.MISMATCH!postnews.google.com!l42g2000hsc.g
    ooglegroups.com!not-for-mail
    | Xref: TK2MSFTNGHUB02.phx.gbl
    microsoft.public.dotnet.framework.aspnet.webcontrols:3986
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    |
    | Hi,
    |
    | I am displaying asp.net datagrid in DIV tag. I have specified
    | following css to DIV.
    |
    |
    | .divBox
    | {
    | border:solid 1px black;
    | min-width : 150px
    | max-height : 150px;
    | background-color : Silver;
    | position:absolute;
    | overflow-y:auto;
    |
    |
    |
    | }
    |
    |
    | It is working fine if width of grid is greater than min-width. But
    | when height is greater than instead of only verticle scroll bar, both
    | scrollbars are being displayed.
    |
    | How can horizontal scroll bar can be avoid.
    |
    |
    | Help is highly appriciated.
    |
    |
    | -Nitya
    |
    |
    |
     
    Allen Chen [MSFT], Sep 16, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeremy Chapman
    Replies:
    1
    Views:
    913
    szabelin
    Aug 15, 2003
  2. Lloyd Sheen

    Horizontal Scroll Bar for listbox

    Lloyd Sheen, Oct 31, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    22,645
    Andrew de la Harpe
    Nov 1, 2003
  3. RJN
    Replies:
    1
    Views:
    5,686
    jongalloway
    Mar 5, 2005
  4. ray well

    auto scrolling horizontal scroll bar

    ray well, Apr 4, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    627
    ray well
    Apr 5, 2005
  5. Guy
    Replies:
    1
    Views:
    38,050
Loading...

Share This Page