जगदीश खोलिया: July 2013

Tuesday, July 9, 2013

Find table row id (inside HeaderTemplate) in a DataList control

Below is the code for finding table row id inside a datalist control:
protected void datalistData_ItemDataBound(object sender, DataListItemEventArgs e)
{
      if (e.Item.ItemType == ListItemType.Header)
     {
          HtmlControl trTableRow = e.Item.FindControl("trOffline") as HtmlControl;
         //where trOffline is row id
     }
}