单击gridview行后显示控件 [英] Display control after clicking the gridview row

查看:69
本文介绍了单击gridview行后显示控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个超过1000行的数据表.当我将值绑定到gridview时,我应该在每行上显示(+)加号.然后,当我单击该+号时,我将在该行下方显示文本框控件.那么该怎么做呢?

Hi,

I have one datatable with more than 1000 rows. When I am binding the values to gridview I should show (+) plus sign each row. Then when i am clicking that + sign I will show textbox control below the row. So how to do?

推荐答案

使用一个呈现表行的列表视图.在每行下方添加一个额外的行,该行隐藏在HTML中.
Use a listview that renders the table rows. Add an extra row under each row, that is hidden in HTML.
style="display:none;"


在此行中,您可以添加更多控件,并且使用jquery可以在用户单击+按钮时使其可见.


In this row you can add more controls and with jquery you can make it visible when the user clicks the + button.

var textbox =


(''#textboxid'').css(''display'', ''block'');
(''#textboxid'').css(''display'', ''block'');



另一个可能性是当用户单击+按钮时回发到页面.之后,确定要单击的行,并仅为此单击的行添加多余的行.



Another possiblitiy is to postback to the page when the user clicks the + button. After that determine what row is clicked, and only add the extra row for this clicked row.


这篇关于单击gridview行后显示控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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