Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how can gridview checkbox enable and disable according to current date
Posted
Comments
DamithSL 16-Dec-14 23:27pm    
what have you tried? what you mean by according to current date? are you comparing column value with current date and then decide checkbox enable state?
Rahul_Pandit 17-Dec-14 0:32am    
try rowdatabound event of gridview and enable disable checkbox by finding them.

1 solution

In the RowDataBound event of gridview compare the today date DateTime.Now or DateTime.Today with your column fields values by using if condition make visiblitiy false for that column which you want to hide


if (e.Row.RowType == DataControlRowType.DataRow)
{
string todaydate = DateTime.Now.ToString();

Label Labelst = (Label)e.Row.FindControl("Label38");

if (Labelst.Text == todaydate)
{
Labelst.Visible=False;
}
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900