数据网格内部的可扩展面板 [英] exapandable panel inside a datagrid

查看:74
本文介绍了数据网格内部的可扩展面板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有asp.net Web表单中的数据网格,我想单击特定的单元格或行,并希望在单击该行时获得面板显示.该行的数据显示在该面板上.
预先谢谢您..

Hi,
I have data grid in asp.net web form and i want to click on particular cell or row and want to get a panel shows on click of that row .Data of that row shows on that panel.
Thank you in advance..

推荐答案

酷男孩,
您可以尝试ajax手风琴

喜欢
Hi coolboy,
you can try ajax accordian

like
<asp:Accordion runat="server">
                                          <Panes>
                                              <asp:AccordionPane runat="server">
//your lable or textboxes
                                              </asp:AccordionPane>
 <Panes>
                                              <asp:AccordionPane runat="server">
//your lable or textboxes
                                              </asp:AccordionPane>

 <Panes>
                                              <asp:AccordionPane runat="server">
//your lable or textboxes
                                              </asp:AccordionPane>

                                          </Panes>
                                      </asp:Accordion>


为此,您可以将div与display属性一起使用:absolute:
For this you can use div with property display:absolute :
<div id="popup" runat="server" style="border: thin solid #000000; text-align: center;
               background-color: White; position: absolute; width: 300px; height: 120px; bottom: 45%;
               right: 38%">
<asp:label id="lbl1" runat="server" xmlns:asp="#unknown"></asp:label>
<asp:label id="lbl2" runat="server" xmlns:asp="#unknown"></asp:label>


根据屏幕设置位置.
然后单击特定的单元格,然后在网格命令"上工作.使用按钮或图像按钮.
点击该按钮:


set position according to your screen.
and work on Command of grid, when you will click on particular cell. use either button or image button.
on click of that :

protected void imgSubmit_Click(object sender, ImageClickEventArgs e)
    {

popup.visible=true;

               int i=Convert.ToInt32(e.CommandArgument);
               lbl1.Text=GridView1.Rows[i].Cells[1].Text;
               lbl2.Text=GridView1.Rows[i].Cells[2].Text;

}



同样,您可以在显示数据后隐藏div.

希望对您有帮助.
如果有帮助,别忘了标记答案. :)



in the same way you can hide the div after show data.

Hope it''ll help you.
Don''t forget to mark answer if it helps you. :)


这篇关于数据网格内部的可扩展面板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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