How to avoid horizontal Scroll bar in DIV Tag

N

nityaprakash

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
 
A

Allen Chen [MSFT]

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:
(e-mail address removed).

==================================================
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: (e-mail address removed)
| 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:
<b091aef2-1389-4253-b74d-673b92b7b5db@l42g2000hsc.googlegroups.com>
| 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: (e-mail address removed)
| NNTP-Posting-Date: Sun, 14 Sep 2008 19:11:02 +0000 (UTC)
| Complaints-To: (e-mail address removed)
| 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
|
|
|
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,900
Latest member
Nell636132

Latest Threads

Top