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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple datagrid on same page

Status
Not open for further replies.

HomerJS

Programmer
Jun 25, 2001
86
US
I have 2 datagrids on the same web page. They are positioned vertically one right after the other. My problem is that the first one overlaps the second one. How can I position the second datagrid so they don't overlap? I was looking for something like datagrid.top but cannot findi it.
 
I never tried this but off the top of my head I would try to create a workaround:

get the number of records in the dataset before you bind the datagrid. Multiply this result by 25 and set it as the height of the first datagrid. This, theoretically, should "push" the other datagrid down.

Am I making any sense here? Daren J. Lahey
Just another computer guy...
If you are unsure of forum etiquette check here FAQ796-2540
 
Yes you're making sense.

I have tried setting the height of the first grid to a large number and it does not adjust the second grid at all. I appreciate the suggestion.
 
=) another suggestion...

I have two datagrids in the same page, but in different tables they don't seem to overlap (but I could be wrong since the forst datagrid has never alot of records).
Encapsulating them in tables could be your solutions...

hth

Daren J. Lahey
Just another computer guy...
If you are unsure of forum etiquette check here FAQ796-2540
 
How do you have the datagrids inside seperate tables? Do you mean like the following, which has errors, or how?


<asp:Table id=&quot;Table1&quot; style=&quot;Z-INDEX: 145; LEFT: 704px; POSITION: absolute; TOP: 648px&quot; runat=&quot;server&quot; Width=&quot;232px&quot; Height=&quot;220px&quot;>
<asp:datagrid id=&quot;ItmChrgGrid&quot; style=&quot;Z-INDEX: 143; LEFT: 24px; POSITION: absolute; TOP: 200px&quot; runat=&quot;server&quot; Width=&quot;736px&quot; AutoGenerateColumns=&quot;False&quot; OnItemCreated=&quot;Item_Created&quot;>
<AlternatingItemStyle BackColor=&quot;WhiteSmoke&quot;></AlternatingItemStyle>
<HeaderStyle HorizontalAlign=&quot;Center&quot;></HeaderStyle>
<Columns>
<asp:BoundColumn DataField=&quot;ITEM_CODE_KEY&quot; HeaderText=&quot;Item Code&quot;>
<HeaderStyle Width=&quot;100px&quot;></HeaderStyle>
</asp:BoundColumn>
.
.
.

</Columns>
</asp:datagrid>
</asp:Table>
 
I use normal HTML Tables:

<TABLE>
<TR>
<TD>
<asp:Datagrid1></asp:Datagrid1>
</TD>
</TR>
</TABLE>
<TABLE>
<TR>
<TD>
<asp:Datagrid2></asp:Datagrid2>
</TD>
</TR>
</TABLE>

hth
Daren J. Lahey
Just another computer guy...
If you are unsure of forum etiquette check here FAQ796-2540
 
use flow layout, also
penny1.gif
penny1.gif
 
I placed each datagrid in its own table as Alcar suggested, both with and without using flow layout, and the datagrids still overlap. I do also clear my temporary files and history before testing the page.

Thanks for the good ideas, keep 'em comin'. :)
 
at this point I would also try Link9s solution:

thread855-406723

hth Daren J. Lahey
Just another computer guy...
If you are unsure of forum etiquette check here FAQ796-2540
 
That did it. Thanks to both of you for all of your help! :)
 
A post mortem note

The flow layout would have worked. I am guessing that you simply changed the layout in the page properties to flow? Your will still have their absolute positioning data in them. To take it out go to the html view and do it manually or just grab the control and move it in the designer. It will then take on flow layout properties. Most likely you'll still need to format the document to get it looking nice again. That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top