I’m binding my grids to collections (IBindingList) and have some columns that don’t bind directly to the given object.
Let say for example I have a person class that I’m binding to and the person class has a member class of phone. I’m binding the grid to person but I want to pull the phoneNumber property through from the phone class. I’ve tried adding an unbound column and hooking the AddingDataRow row event. My theory was that e.DataRow.Tag would contain the person object from which I could set the value of the phone column. Something along these lines:
e.DataRow.Cells[“PhoneNumber”].value = ((Person)e.DataRow.Tag).Phone.PhoneNumber
However the Tag property always seems to be null. Is there another way for me to access the object attached to the current DataRow? Or am I ooking at this all wrong.
Imported from legacy forums. Posted by jallenMCA (had 2971 views)