如何按列名隐藏gridview列

时间:2017-05-30 13:33:04

标签: c# asp.net gridview

我的问题是:如何使用caolumn名称隐藏gridview特定列? 我想通过radiobutton chekced_chenged事件隐藏列,但这是索引,但我想隐藏使用列name.sorry我的坏英语。

if (element.classList.contains('is-valid')) {
  // Do something
}

1 个答案:

答案 0 :(得分:0)

首先,目前还不清楚你在问什么,但根据我的理解,这里是我能理解的内容 您不需要为此设置c#代码,尽可能保持服务器免受这些开销,现在有一天你有像bootstarp这样的东西
使用媒体查询隐藏列或多列Check this out

@media only screen  {
#unseen table td:nth-child(4),
#unseen table th:nth-child(4),
#unseen table td:nth-child(7),
#unseen table th:nth-child(7),
#unseen table td:nth-child(8),
#unseen table th:nth-child(8){display: none;}
}


或使用javascript

<script>
    $(document).ready(function () {
        $('input:radio[name=rdbtnCGSTSGST]:checked').change(function () {
             $('table tr').each(function() { 
                $('td:eq(' index here  ')',this).hide();
             });

        });
    });
</script>
相关问题