AhmedHindy
asked on
grid view cell text problem
am trying to get the value of the cell of grid view
if it is
"abc"
change the back ground of grid row
but
_grid.Rows[index].Cells[1] .Text
always get the result = ""
any help ??????????
if it is
"abc"
change the back ground of grid row
but
_grid.Rows[index].Cells[1]
always get the result = ""
any help ??????????
private void FormateGrid(GridView _grid)
{
for (int i = 0; i < _grid.Rows.Count; i++)
{
if (_grid.Rows[i].Cells[1].Text.Contains("abc"))
{
_grid.Rows[i].BackColor = System.Drawing.Color.Blue;
}
}
}
Try like this
foreach (GridViewRow gvrow in _grid.Rows)
{
//Assuming you are finding text which in label
Label lbl = (Label)gvrow.FindControl(" Label1");
if(lbl!= null)
{
string search_text = lbl.Text;
}
}
foreach (GridViewRow gvrow in _grid.Rows)
{
//Assuming you are finding text which in label
Label lbl = (Label)gvrow.FindControl("
if(lbl!= null)
{
string search_text = lbl.Text;
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
worked for me
ASKER
worked
ASKER
worked
Open in new window