How to Show custom text based on condition in gridview

Shubham
Posted by Shubham under ASP.NET category on | Points: 40 | Views : 1815
public void SetGridCtrls()
{
for (int i = 0; i < GridView1.Rows.Count; i++)
{
string l = GridView1.DataKeys[i].Values[2].ToString();
if (l != ".")//////////here is yours conditions
{
GridView1.Rows[i].Cells[11].Enabled = false;
GridView1.Rows[i].Cells[11].Text = "Under Offer";


}
}
}

Comments or Responses

Login to post response