C# .NET - datalist ItemDataBound

Asked By shweta on 17-Jul-10 04:04 AM
I am supplying a shopcollection as datasource to datalist. Now, i want to check on item databound that for each shop, if publish attribute is checked or not (1 or 0), if it is 1 i want a particular set of code to run and otherwise
Peter Bromberg replied to shweta on 17-Jul-10 05:33 PM

This is just an example:



 protected void DataList1_ItemDatabound(object sender, DataListItemEventArgs e)
    {
      if (e.Item.ItemType == ListItemType.Footer)
      {
        Literal lit;
        lit = (Literal)e.Item.FindControl("litPagerLinks");
        lit.Text = Pager.CreatePagerLinks(pagedData, Request.CurrentExecutionFilePath + "?a=1");
      }
    }

 You can also access the underlying datasource row here and perform your logic.

dddd replied to shweta on 17-Aug-11 05:08 AM
asfdsffdf g htfffffffffffffffffffffffffff ffffffffffffffff
dgjfhg
fhgfjh igjhg ijh  gfhgjh
kuch samajh me aaya ki nahi