Question : asp.net I need to be able to count and provide a total in the footer for every row that is not locked out


I need to be able to count and provide a total in the footer for every row that is not locked out
the lockout field is a datetime. if the field is blank it is not locked out, if any date value is in this field it is locked out. so i want to be able to count the number of rows that are not locked out?

See image of gridview
Attachments:
 
gridview image
gridview image
 

Answer : asp.net I need to be able to count and provide a total in the footer for every row that is not locked out

Here is some code to find a control inside a footer on the rowdatabound event..in this example they find a ddl....obviously you are looking for a differnt control...and doing something when you find it..but same concept.


if (e.Row.RowType == DataControlRowType.Footer)
{
GridViewRow row = grdValidations.FooterRow;
Control ctl = row.FindControl("drpdnFieldName");

DropDownList ddl = ctl as DropDownList;
if(ddl != null)
{
//you can do what evey you want to do with the dropdownlist here

ddl
}

Random Solutions  
 
programming4us programming4us