Yeah, I see your problem. I've had to think long and hard about this issue!

You can use `$state->getData('TestVar', false);` to get the data you need in this case.

Still, I agree this API could be improved and is a bit awkward still. We could change the mentioned 'empty' check to '!isset', and update the docs to describe how to use `getData`. The disadvantage of the approach you are attempting is that if you want to not use the getData function and access the variable as a property, you'll need to make sure that you ensure that your variables are set prior to retrieval; The case above you demonstrate a case where you would like to use this function in this way, but if you omitted the `$state->TestVar = false;` explicitly then your isset would still fail and you'd get a GridState_Data object. This is why I found it more robust to specify the default on the `getData` method instead. In some gridstate components it's not 100% clear where the best place to set the default value; If it's not done in the getter then it would need to be in the component constructor in some form similar to.

`if!(isset($state->TestVar)) $state->TestVar = false;`

I agree though, my use of empty was probably in error; Although reverting to isset would probably necessitate some other way of 'clearing' a data field rather than setting it to an empty value. :)