如何在单击下拉列表时显示右侧视图 [英] How To Displaygridview Right Side When I Click Dropdown

查看:76
本文介绍了如何在单击下拉列表时显示右侧视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的设计如下



分支ddlbranch(下拉列表)



一个gridview(gvResult)gridview姓名



类型ddlfeedbacktype(下拉列表)

主题txtsubject(文本框)

评论txtcomments(文本框)



提交(按钮)



当我点击ddlbranch(下拉列表)时我想显示gridview(gvResult)

.Gridview显示没问题。



但我想在righ sid中显示Gridview(gvResult)。当我点击ddlbranch(下拉列表)。



我的来源如下



My design as follows

Branch ddlbranch(dropdownlist)

One gridview (gvResult) gridview name

Type ddlfeedbacktype (dropdownlist)
Subject txtsubject(textbox)
Comments txtcomments(textbox)

Submit(Button)

When i click ddlbranch (dropdownlist) i want to show the gridview (gvResult)
.Gridview is displaying no problem.

But i want to display the Gridview (gvResult) in righ sid. when i click the ddlbranch (dropdownlist).

My source as follows

<asp:Panel ID="ff" runat="server" Height="451px" BackColor="Bisque" 

    BorderColor="BlanchedAlmond" BorderStyle="Groove" Width="931px">
   <table style="height: 165px; width: 301px">
      
       
    <tr>
         <td>
           <asp:Label ID="lblbranch" runat="server" Text="Branch">
                 
           <asp:DropDownList ID="ddlbranch" runat="server" 

                 onselectedindexchanged="ddlbranch_SelectedIndexChanged">
               <asp:ListItem>KALPAKKAM
               <asp:ListItem>KILPAUK
               <asp:ListItem>TIDELPARK
           

            <asp:Panel ID="pnlresult" runat="server">
                              <asp:GridView ID="gvResult" runat="server" BackColor="LightGoldenrodYellow" 

                                  BorderColor="Tan" BorderWidth="1px" CellPadding="2" ForeColor="Black" 

                                  GridLines="None">
                                  <alternatingrowstyle backcolor="PaleGoldenrod" />
                                  <footerstyle backcolor="Tan" />
                                  <HeaderStyle BackColor="Tan" Font-Bold="True" />
                                  <pagerstyle backcolor="PaleGoldenrod" forecolor="DarkSlateBlue">
                                      HorizontalAlign="Center" />
                                  <SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
                                  <sortedascendingcellstyle backcolor="#FAFAE7" />
                                  <sortedascendingheaderstyle backcolor="#DAC09E" />
                                  <sorteddescendingcellstyle backcolor="#E1DB9C" />
                                  <sorteddescendingheaderstyle backcolor="#C2A47B" />
                             
                        
       </pagerstyle></td>
    </tr>

      
   <tr>
        <td>
         <asp:Label ID="lblfeedbacktype" runat="server" Text="Type">
                            
         <asp:DropDownList ID="ddlfeedbacktype" runat="server"> 
                             
       </td>
</tr>

      <tr>
         <td>
            <asp:Label ID="lblsubject" runat="server" Text="Subject">
                           
            <asp:TextBox ID="txtsubject" runat="server">
         </td>
    </tr>

     <tr>
        <td>
            <asp:Label ID="lblcomments" runat="server" Text="Comments">
                            
            <asp:TextBox ID="txtcomments" runat="server">
        </td>
  </tr>
     
                     <tr>
                          <td>
                             <asp:Button ID="btnSave"   Text="Submit" />   
                         </td>
                   </tr>
   </table>





当我点击下拉列表(ddlbrnach)时我想要在右侧显示gridview,而不是在下拉列表的下方。





来自我的上述来源我必须做出哪些更改才能获得正确的输出。





问候,

Narasiman P.



When i click the dropdownlist (ddlbrnach) i want to show the gridview in right side not in below of dropdownlist.


from my above source what changes i have to made to get correct output.


Regards,
Narasiman P.

推荐答案

尝试将包含gridview的面板放在div中并应用css类似于-



Try putting the panel containing the gridview in a div and applying css something like-

position:absolute;
right:0px;





希望有所帮助:)



Hope it helps :)


除了解决方案#1,你可以使用HTML表格;)

Apart from solution #1, you can use HTML table ;)
<table>
    <tr>
        <td>
            <!-- your dropdown -->
        </td>
        <td>
            <!-- your gridview -->
        </td>
    </tr>
</table>





但是它建议使用CSS。



-KR



But it is recommend to use CSS.

-KR


这篇关于如何在单击下拉列表时显示右侧视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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