简单的Gridview和按钮问题。我正在学习Asp.Net。请帮助我! [英] Simple Gridview and button problems. I am learning Asp.Net. Please help me out!

查看:91
本文介绍了简单的Gridview和按钮问题。我正在学习Asp.Net。请帮助我!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不会说我浪费了我的时间,但花了几个小时改变了这一点。但是入侵。有人可以帮我解决。
在下面的代码中:


  1. 我需要在禁用位置(标题)和gridview之间使用break

  2. 我希望网格的边框颜色为无。我不需要任何颜色。

  3. 我希望按钮禁用或取消激活,取消显示在gridview下方。并在页面中间。

请帮助我!非常感谢。

 < body> 
< form id =form1runat =server>

< div style =display:block; background:url(images / reusable_blue_bg.jpg)repeat-x 0 -15px;
border-left:#88b9c7 1px solid; border-底部:#88b9c7 1px solid; border-top:#88b9c7 1px solid;
border-right:#88b9c7 1px solid; padding:0px 2px; height:236px; min-height:236px;
height: auto; margin-left:auto; margin-right:auto;>
border-left-style:none; border-bottom -style:noneid =TABLE1>

< tr>
font-family:Arial; color:#1e7c9b ;>
禁用位置< / td>
< / tr>

我在这里需要1号码。



< pre $ < asp:GridView ID =disablelocrunat =serverAutoGenerateColumns =FalseDataKeyNames =LocationName
DataSourceID =AllowPaging =TrueEnableViewState =trueBorderStyle =None>

我想要2在这里,我想

 < / asp:GridView> 

我想要3在这里..

 < tr align =centerstyle =position:fixed> 
< asp:ImageButton ID =btnDisablerunat =serverImageAlign =MiddleImageUrl =〜/ images / green-deactivate.gifOnClick =btnDisable_Click
ValidationGroup =group1 />

< asp:ImageButton ID =btnCancelrunat =serverImageUrl =〜/ images / cancel.gifOnClick =btnCancel_Click/>

< / tr>
< / table>

< / div>

非常感谢!

解决方案


  1. 使用标题td的样式上的padding-bottom来获取标题和gridview之间的空间。
  2. 使用gridlines =None。

  3. 包装GridView和tds中的按钮,现在它们直接在tr中,而且这不完全正确,因此按钮显示表格的左上角。


I would not say I wasted my time, but spent around few hours changing this. But invain. Could some one please help me out. In the following code:

  1. I need to use break in between Disable Location(Title) and the gridview
  2. I want the border color of grid to none. I do not want any color.
  3. I want both the buttons Disable or deactivate and Cancel to be displayed just below the gridview. and in the middle of the page.

Please help me out!! Thanks alot.

<body>
    <form id="form1" runat="server">

    <div style="display: block; background: url(images/reusable_blue_bg.jpg) repeat-x 0 -15px;
        border-left: #88b9c7 1px solid; border-bottom: #88b9c7 1px solid; border-top: #88b9c7 1px solid;
        border-right: #88b9c7 1px solid; padding: 0px 2px; height: 236px; min-height: 236px;
        height: auto; margin-left: auto; margin-right: auto;">
        <table align="center" style="width: 554px; border-top-style: none; border-right-style: none;
            border-left-style: none; border-bottom-style: none" id="TABLE1">

            <tr>
                <td align="center" colspan="5" style="font-weight: normal; font-size: 20px; margin: 0px;
                    font-family: Arial; color: #1e7c9b;">
                    Disable Location</td>
            </tr>

I need number 1 over here..

            <asp:GridView ID="disableloc" runat="server" AutoGenerateColumns="False" DataKeyNames="LocationName"
                DataSourceID="" AllowPaging="True" EnableViewState="true" BorderStyle="None">

i want 2 over here, i guess

            </asp:GridView>

I want 3 in here..

            <tr align ="center" style="position:fixed">
               <asp:ImageButton ID="btnDisable" runat="server" ImageAlign="Middle" ImageUrl="~/images/green-deactivate.gif" OnClick="btnDisable_Click"
                    ValidationGroup="group1" />

               <asp:ImageButton ID="btnCancel" runat="server" ImageUrl="~/images/cancel.gif" OnClick="btnCancel_Click" />

            </tr>
         </table>

    </div>

Thankss so much!!

解决方案

  1. Use padding-bottom on the style of the header td to get the space between the header and the gridview.
  2. Use gridlines="None" on the GridView.
  3. Wrap both the GridView and the buttons in tds, now they're directly in the tr and that's not exactly ok html so the button wind up in the top left corner of the table.

这篇关于简单的Gridview和按钮问题。我正在学习Asp.Net。请帮助我!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆