Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to lock the height of gridview rows

Status
Not open for further replies.

MzKitty

Programmer
Oct 28, 2003
254
US
Hi. I'm using VS2008. I have a gridview that has 16 rows, however if the user fills only one row in the gridview with his data query, the row heighth is 5 times as big. I tried setting the row heighth to 22px, but it doesn't seem to care. Is there a way to set the gridview row heighth so it doesn't do this? I want the row height to be same height on the screen regardless of there being 16 rows or 1.

Thanks
Cathy
 
It must be something in the markup of the gridview. You must have set a height property somewhere. Post the HTML for your gridview.
 
I set a height for the gridview size. After I removed it, everything was fine. Sorry for asking, but I'm new to ASP and thought I had to set a size so it didn't fill the whole webpage. Thanks for your fast reply.

Cathy
 
MzKitty I would recommend using CSS to style your page elements. avoid layout concerns in the code behind. all you should be doing there is getting data to/from the markup and redirects.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
 
Thanks Jason. I'll check it out. I've never heard of CSS; it's the downfall of learning web programming as you go. I started out as a cobol programmer, now I'm doing this. Always learning!
 
CSS is cascading style sheets. it is the preferred method to defining the layout of a webpage.

I will also throw out a point of caution. webforms has it's merits (few and far between from my POV). However there are also a lot of things webforms does very poorly.
1. create the illusion of state where there is none.
2. has a complicated abstraction for a simple concept like html.
3. it's so coupled to itself there are very few, if any, extension points to add custom functionality.

what you encountered (setting the height) is a perfect example. webforms created a pseudo complete set of style features for the server model of a Page rather than using CSS as the preferred choice for defining layout.

if this peaks your interest any, google "problems with webforms", "pitfalls of webforms" or "webforms vs. mvc". a lot of developers have a lot of opinions about where webforms stacks up as a web development tool.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top