It's normal that you get null reference for the DataItem, you could only get it when NodeDataBound event is fired. My suggestion is to bind this IDs to be the values for each node , or if you have already binded data to the node value , you could still bind it to a custom attribute. More information about the custom attributes you could find here.