.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 2nd, 2004, 10:17 PM
babneet babneet is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 4 babneet User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Adding Scroll Bar to DataGrid: Height Problem

Hi,

I have added scroll bar to a datagrid using div tag:


<div style="OVERFLOW:auto;HEIGHT:360px">

{datagrid code}

</div>

I am getting the data from the db. So the restult set will be
different in size everytime.

If I fix the height to 360px, i have a problem if the result set only contains few items.
say 1 or 2. However, since the width is 360px, so it adds empty sapce to make it to 360px.

How can i fix this spacing problem.

Please reply.

Regards,
Babneet

Reply With Quote
  #2  
Old May 3rd, 2004, 06:07 AM
rkabir rkabir is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 4 rkabir User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Solving Height Problem

One easy advice would be, after binding the datagrid find the height of the grid and set the height of the DIV accordingly.
To achieve this declare the DIV as runat="server" and give it a ID such as DIV1

After binding the datagrid do the following


String DataGridHeight = DataGrid1.Height.ToString();
DIV1.Style.Add("height", DataGridHeight);



-------
Rezaul Kabir

Reply With Quote
  #3  
Old May 4th, 2004, 01:09 AM
babneet babneet is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 4 babneet User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi Kabir,

How can I access the DIV1 in the code behind?

say <div> tag has id DIV1.
I have to declair it, like we do for Label.

and also everytime I do dataGrid.Height.toString(), it is empty string.

Cheers,
Babneet

Reply With Quote
  #4  
Old May 9th, 2004, 11:31 PM
babneet babneet is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 4 babneet User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks

Do not worry. It is working now.

Thanks for your help.
Babneet

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > Adding Scroll Bar to DataGrid: Height Problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT