如何在有条件的情况下隐藏在网格视图Perticuler Celll中 [英] How to Hide In grid View Perticuler Celll with condinition

查看:133
本文介绍了如何在有条件的情况下隐藏在网格视图Perticuler Celll中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友我有数据表,我希望其中有六列(Tagid,Tagname,Tagvalue1,Tagvalue2,Tagvalue3,Tagvalue4)和70行


如果标记名包含像"Genaraion"这样的标记名,那么我想在网格视图中隐藏该列的Tagvalue1,Tagvalue2,Tagvalue3,Tagvalue4的相应单元格

我认为您已经了解了此问题

hey friend i have datatable in which i want there are six column(Tagid,Tagname,Tagvalue1,Tagvalue2,Tagvalue3,Tagvalue4) and 70 row


if tagname contain tagname like "Genaraion" so i want hide respective cell of Tagvalue1,Tagvalue2,Tagvalue3,Tagvalue4 this colomn in grid view

i think you have understand this problem

推荐答案

您需要遍历数据表中的每一行,并检查是否有任何行的文字与列"标记名中的"Genaraion"相同,然后清除该行中相应单元格的值.
示例伪代码如下:
You need to traverse the each row in datatable and check whether any row have text same as "Genaraion" in Column tagname then clear the respective cell''s value from that row.
Sample pseudo code is below:
Private HideRowValues()
{
    For(int i=0; i<DataTable1.Rows.Count-1; i++)
        {
            if(DataTable1.CurrentRow.Cell["tagname"].Text == "Genaraion")
            {
                DataTable1.Rows[i].Cell["Tagvalue1"].Text = "";
                DataTable1.Rows[i].Cell["Tagvalue2"].Text = "";
            }
            DataTable1.Update();
        }
}



希望你明白了.
而且,可以自己在VB中编写代码.



Hope you got the point.
And, Code in VB by yourself.


这篇关于如何在有条件的情况下隐藏在网格视图Perticuler Celll中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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