Click here to Skip to main content
15,881,413 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more:
Hi,

In datagrid_ItemDataBound I have some code for set an onclick eventhandler for Items but:
How can I check the item is not header because I do not want to set onclick for header or foter or .......?
Posted

1 solution

Before setting onclick :


C#
if ((e.Item.ItemType == ListItemType.Header) || (e.Item.ItemType == ListItemType.Pager) || (e.Item.ItemType == ListItemType.Footer))
      return;
 
Share this answer
 
Comments
RusselSSC 6-Mar-12 8:11am    
thank you for quick answering maria

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