I want to hide empty row in one particular column. I tried to but negative. Below is my code:
protected void gvDb_DataBound(object sender, EventArgs e)
{
foreach (GridViewRow rw in gvDb.Rows)
{
if ((string.IsNullOrEmpty(rw.Cells[1].Text) | (rw.Cells[1].Text == "")))
{
rw.Visible = false;
}
}
}

Sundaram SubramanianRank #150 · 15.2K reputationPosted Jun 15, 2017, 12:52 AM EDT
protected void gvDb_RowDataBound(object sender, GridViewRowEventArgs e) { //Loop thorugh the rows in gridview if (e.Row.RowType == DataControlRowType.DataRow) { //Get the Label control here Label lblctrl = (Label)e.Row.FindControl("Label1"); //Check if array contain the current item text in label if ((string.IsNullOrEmpty(lblCtrl) | (lblctrl == ""))) { //Hide the Particular row e.Row.Visible = false; } } }rajeev kumar101 reputationPosted Jun 15, 2017, 12:52 AM EDT
if (e.Row.RowType == DataControlRowType.DataRow){ JobPieceSerialNo item = e.Row.DataItem as JobPieceSerialNo;if (item != null) { if (string.IsNullOrEmpty(item.Reason)){ e.Row.Visible = false; } }Rajkiran SwainRank #165 · 14.4K reputationPosted Jun 15, 2017, 2:02 AM EDT