[英]How to check if column of GridView is empty, and if it is, make a button invisible?
我有以下代碼:
var data = File.ReadAllLines(Server.MapPath("~/Uploaded"))
.Select(line => line.Split(','))
.Select(columns => new { GuestName = ErrorMessage(columns[0]),
Guest_ID = ErrorMessage(columns[1]),
IC_Number = ErrorMessage(columns[2]) });
if (data = 0)//this if statement is wrong
{
BtnImport1.Visible = false;
}
我想檢查GridView
的列/行是否為空,如果是,我想使BtnImport
變得不可見。 有人可以幫我嗎? = /
if (data.Count() == 0)//this if statement is wrong
{
BtnImport1.Visible = false;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.