开发者

How to check if column of GridView is empty, and if it is, make a button invisible?

开发者 https://www.devze.com 2023-03-31 15:23 出处:网络
I have this codes: var data = File.ReadAllLines(Server.MapPath(\"~/Uploaded\")) .Select(line => line.Split(\',\'))

I have this codes:

var data = File.ReadAllLines(Server.MapPath("~/Uploaded"))
              .Select(line => line.Split(','))
              .Select(columns => new { GuestName = ErrorMessage(columns[0]), 
                                       Guest_ID = ErrorMessage开发者_Go百科(columns[1]), 
                                       IC_Number = ErrorMessage(columns[2]) });
            if (data = 0)//this if statement is wrong
            {
                BtnImport1.Visible = false;
            }

I want to check if the the column/row in the GridView is empty, if it is, I want to make the BtnImport to become invisble. Can anyone help me on with this? =/


if (data.Count() == 0)//this if statement is wrong
{
    BtnImport1.Visible = false;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消