Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


how to make height of gridview

Posted on 2007-08-07
Medium Priority
Last Modified: 2012-06-27
I have gridview that has div, and I put a headerfixed on it, only thing is, if my data is short this much height I don't want to see, I want height to be adjusted accordingly to my data, if it is too many records heights going to be more, if less less height. How can I do that without effecting my fixedheader?
<div style="width: 530px; overflow:auto; height: 200px;" >
Question by:jaws1021
  • 2
  • 2
LVL 12

Accepted Solution

renjurdevan earned 1000 total points
ID: 19651247
if you want to set height dynamically you can use javascript like

<div style="width: 530px; overflow:auto; height: 200px;" id = "MYDIV">

document.getElementById("MYDIV").style.height =  120;

where MYDIV is id of the div !! you can set size like this !! Get the record count in a hidden field and according to the value set height!!


Author Comment

ID: 19651582
can you give me an example about getting record count in a hidden filed and set the height that way?
LVL 16

Assisted Solution

ellandrd earned 1000 total points
ID: 19652781
My advise is to set a fixed rows height.  that way you dont have to mess about with your header div.

Author Comment

ID: 19657399
my rows are not fixed though. They are changing depends on data..
LVL 16

Expert Comment

ID: 19660255
can we see any example of this page?

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses
Course of the Month14 days, 8 hours left to enroll

578 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