Hi,
To change the visibility of any button or any control based on some
condition in grid, you can create 1 function after binding the grid.
Say,
..
grdcustomers.databind();
CheckGridForVisibility();
add this function to your page..
public void CheckGridForVisibility()
{
for (int i = 0; i < grdCustomers.Rows.Count; i++)
{
Label lbldatetime =
(Label)grdCustomers.Rows[i].FindControl("lblDataTime");
if (lbldatetime.Text == DateTime.Today.ToString())
{
Button btnedit =
grdCustomers.Rows[i].FindControl("btnEdit");
btnedit.Visible = false;
}
}
}
Hope this will help you..
Regards,
Mansi Shah.
*** Sent via Developersdex
http://www.developersdex.com ***