Solved

CSS POSITION absolute vs relative, how to push down content relative to the row results of a datagrid?

Posted on 2004-03-31
5
1,108 Views
Last Modified: 2008-01-16

Hello,

I am having a problem with a datagrid that spits out any number of rows depending upon the query.  I need to have multiple input controls underneath the results.  The problem is that the datagrid just runs into (over) the input controls.  

I tried placing the input controls in a container like so:

<asp:panel style="position:relative">
   <input type=text>
   <br>
   <input type=text>
   <br>
   <input type=text>
   <br>
   <input type=text>
</asp:panel>

What is the best way to handle this?  I thought there was a way to make the container relative and therefore dynamic.  This article is good, but I don't have enough information to make it work:

http://www.stopdesign.com/also/articles/absolute/

Thanks very much!
0
Comment
Question by:ee_id
  • 3
  • 2
5 Comments
 
LVL 10

Expert Comment

by:Kavar
ID: 10728271
set the position to the control you want to be relative to, to absolute, then set the position of these controls to absolute with a value of the other controls position plus the offset..

i.e.

control1.style.postion="absolute"
control2.style.postion="absolute"
control2.style.top=cstr(int(replace(control1.style.top),"px","") + OFFSET) & "px"
control2.style.left=cstr(int(replace(control1.style.left),"px","") + OFFSET) & "px"

my idiom is:
If you can't beatem, ignore 'em

:}
0
 

Author Comment

by:ee_id
ID: 10729180

Ok, I follow what you ar trying to do, but forgive me for asking how you propose finding the OFFSET... the input fields need to be consistently positioned about 30px from the bottom of the last record.  Remeber, the number of record results can be from 0 to infiniti =)
0
 
LVL 10

Expert Comment

by:Kavar
ID: 10729546
use a script that that finds the absolute position of the last item...
0
 
LVL 10

Accepted Solution

by:
Kavar earned 500 total points
ID: 10729558
your offset is going to be 30

the control1 is the last control / element on the page  each element will always take up the same space, without imperical data, just pick 30, so... to get the top, just mutliply 30 * number of items, (which you can calculate or use your script to find the number of elements after they are written)

maybe the elements are only 20 tall... that being the case change your multiplier and test,

I have found that in many cases, the one time work arounds save hours of programming.  The truly great programmers know when to use a work around and when to buckle down and use the "Real" answer.  We can try and work on the "Real" Solution if you like, but in the interest of time, I think this other method will suffice.

Let me know :)
0
 

Author Comment

by:ee_id
ID: 10732631
I agree- work smart not hard.  You have earned your points!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
numbers ascending pyramid 101 214
Please explain: Aspect Oriented Programming 2 101
How to remove numeric and alpha from an alphanumeric field? 5 94
Create .bat File 16 37
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

820 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