Forum Discussion

rlent's avatar
rlent
Contributor
14 years ago

Testing for Null Object

I am using a DevExpress TreeList. I have an object that I want to check how many children it has. It's fine if it has children, but if it doesn't, it shows up as (Null Object). If it doesn't have any children, it doesn't have a wRowCount of 0, the wRowCount simply doesn't exist. If I could verify that this is a Null Object, that would be fine, but I can't figure out how to do this.



I tried IsNull(XYZ.WinFormsObject("dataFieldTree1").WinFormsObject("dataFieldTreeList").wChildView(0)), but that just reports false.



I want to check if this is a Null Object before I check the wRowCount property, because otherwise it's going to blow up if it is a Null Object, the wRowCount property won't exist.