How to check if column of GridView is empty, and if it is, make a button invisible?
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;
}
精彩评论