Results 1 to 11 of 11

Thread: Buttons getting covered by DataGrid [RESOLVED]

  1. #1

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075

    Buttons getting covered by DataGrid [RESOLVED]

    I have a datagrid on my page and some buttons at the bottom that are outside of the datagrid. The problem is at run-time the buttons get covered when the datagrid gets populated. Has anyone come across this issue? Any suggestions?

    thanks,
    eye
    Last edited by EyeTalion; Nov 18th, 2002 at 10:38 AM.

  2. #2
    C# Aficionado Lord_Rat's Avatar
    Join Date
    Sep 2001
    Location
    Cave
    Posts
    2,497
    Sounds like you are in GRID LAYOUT and you absolutely positioned the buttons.

    Switch to flow loyout in the properties pane of the page and then edit the HTML and remove the style definitions that position the buttons absolutely.
    Need to re-register ASP.NET?
    C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i

    (Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)

  3. #3

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075
    if I remove the style attributes, then the buttons go to the top of the page and I can't move them?

  4. #4
    Lively Member
    Join Date
    Aug 2002
    Location
    outerspace
    Posts
    126
    you need to go to the html view and positioning using html perferablly putting them into a table see if that works
    "All those who wonder are not lost" -j.r.r tolkien

  5. #5

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075
    placed them in a table but the datagrid is still overlapping the buttons...

  6. #6
    C# Aficionado Lord_Rat's Avatar
    Join Date
    Sep 2001
    Location
    Cave
    Posts
    2,497
    The style needs to be removed from the datagrid as well.
    Need to re-register ASP.NET?
    C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i

    (Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)

  7. #7

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075
    but if the style attribute isn't set in the tag, the datagrid will be placed at the top of the page

  8. #8
    C# Aficionado Lord_Rat's Avatar
    Join Date
    Sep 2001
    Location
    Cave
    Posts
    2,497
    Correct.

    Tell you what. Could you put the code for the ASPX page here?
    Need to re-register ASP.NET?
    C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i

    (Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)

  9. #9

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075
    <asp:datagrid id=DataGrid1 style="Z-INDEX: 107; LEFT: 16px; POSITION: absolute; TOP: 159px" runat="server" Width="811px" Height="248px" Font-Names="Courier New" DataMember="PBSS_BID" DataSource="<%# DataSet22 %>" AutoGenerateColumns="False">
    <AlternatingItemStyle ForeColor="Black" BackColor="Ivory"></AlternatingItemStyle>
    <HeaderStyle Font-Bold="True" ForeColor="Black" BackColor="LightGray"></HeaderStyle>
    <Columns>
    <asp:TemplateColumn SortExpression="BID_DATE" HeaderText="DATE">
    <ItemTemplate>
    <%# Container.DataItem ("Bid_Date").ToShortDateString()%>
    </ItemTemplate>
    </asp:TemplateColumn>
    <asp:BoundColumn DataField="BID_ID" SortExpression="BID_ID" HeaderText="BID"></asp:BoundColumn>
    <asp:BoundColumn DataField="BID_SCHEDULE_DESC" SortExpression="BID_SCHEDULE_DESC" HeaderText="DESCRIPTION"></asp:BoundColumn>
    <asp:BoundColumn DataField="BUYER_NAME" SortExpression="BUYER_NAME" HeaderText="BUYER"></asp:BoundColumn>
    <asp:BoundColumn DataField="EXPR1" SortExpression="EXPR1" HeaderText="POST TO WEB"></asp:BoundColumn>
    <asp:TemplateColumn SortExpression="DISPLAY_START_DATE" HeaderText="DISPLAY START DATE">
    <ItemTemplate>
    <%# Container.DataItem ("Display_Start_Date").ToShortDateString()%>
    </ItemTemplate>
    </asp:TemplateColumn>
    <asp:TemplateColumn SortExpression="DISPLAY_END_DATE" HeaderText="DISPLAY END DATE">
    <ItemTemplate>
    <%# Container.DataItem ("Display_End_Date").ToShortDateString()%>
    </ItemTemplate>
    </asp:TemplateColumn>
    </Columns>
    </asp:datagrid>
    <TABLE id="Table1" style="Z-INDEX: 108; LEFT: 16px; WIDTH: 164px; POSITION: absolute; TOP: 415px; HEIGHT: 63px" cellSpacing="1" cellPadding="1" width="164">
    <TR>
    <TD style="WIDTH: 76px">
    <asp:button id="btnPrint" runat="server" Height="31px" Width="73px" Text="Print"></asp:button></TD>
    <TD>
    <asp:button id="btnMenu" runat="server" Width="72px" Height="31px" Text="Menu"></asp:button></TD>
    </TR>
    </TABLE>

  10. #10
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    Fort Collins, CO
    Posts
    366
    take off all of the absolute positioning styles as mentioned before and put everything you want on your page in a table, something like so:
    Code:
    <%@ Page language="c#" 
    	Codebehind="Authors.aspx.cs" 
    	AutoEventWireup="false" 
    	Inherits=".Authors" %>
    <html>
      <head>
        <title>Authors</title>
      </head>
      <body>
    	
        <form id="Authors" method="post" runat="server">
    		<table>
    			<tr>
    				<td><input type="button" value="A Button Above"/></td>
    			</tr>
    			<tr>
    				<td>
    					<asp:DataGrid ID="AuthorList"
    						Runat="server"
    						AllowPaging="True"
    						PageSize = "5"
    						PagerStyle-Mode="NextPrev"
    						PagerStyle-NextPageText="Next"
    						PagerStyle-PrevPageText="Prev"
    						PagerStyle-Position="Top"
    						OnPageIndexChanged="PageIndexChanged"
    						AutoGenerateColumns="False"
    						AllowSorting="True"
    						OnSortCommand="Sort">
    						<Columns>
    							<asp:BoundColumn DataField="au_id"
    								SortExpression="au_id"
    								HeaderText="Author ID"/>
    							<asp:BoundColumn DataField="au_lname"
    								SortExpression="au_lname"
    								HeaderText="Last Name"/>
    							<asp:BoundColumn DataField="au_fname"
    								SortExpression="au_fname"
    								HeaderText="First Name"/>
    						</Columns>	
    					</asp:DataGrid>
    				</td>
    			</tr>
    			<tr>
    				<td><input type="button" value="A Button Below"/></td>
    			</tr>
    		</table>
         </form>
    	
      </body>
    </html>

  11. #11

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075
    that did it...thanks pvb

    eye

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width