I have a condition if today is before than finish date then finish button should be hide.here is my click eventEDITING CODE\[code\] protected void btnUpdate_Click(object sender, CommandEventArgs e){ int idx = Convert.ToInt32(e.CommandArgument); GridViewRow gr = gvResTasks.Rows[idx]; string sDateStart = ""; DateTime dtStart; //todo: check against date start date finish, if is not today then dun allow for Mark complete. int Rows = gvResTasks.Rows.Count; for (int x = 0; x < Rows; x++) { GridViewRow tr = gvResTasks.Rows[x]; tr.CssClass = "WhiteBack"; } gr.CssClass = "TealBack"; string sMainTaskID = gr.Cells[0].Text; lblMainTaskID.Text = sMainTaskID; lblMainTaskName.Text = @gr.Cells[1].Text; lblStartDate.Text = gr.Cells[5].Text; dtStart = Convert.ToDateTime(lblStartDate.Text); if (dtStart <= DateTime.Now) { //LoadMainTaskInfo(); //panelUpdate.CssClass = "float"; //panelUpdate.Visible = false; //panelUpdate.Visible = true; UpdateFinishStatus(); } else { panelError.Visible = true; Label4.Text = "Date start not yet reach. Please rebaseline using publishing client if you wish to shift this task earlier."; }}\[/code\]