**STEP 1:** Ensure your _Person_ model has a relation defined to the _Country_ model. You can also implement a getter for CountryName.
### Setup base model
```php
/* ActiveRelation */
public function getCountry()
[...]
**STEP 2:** Add an attribute _countryName_ to your model _PersonSearch_ and configure your rules.
### Setup search model
```php
/* your calculated attribute */
public $countryName;
[...]
**STEP 3:** Configure your gridview columns in your view _index_ file
### Setup view file
**STEP 1:** Ensure your _Person_ model has a self join relation defined to itself. You can also implement a getter for ParentName.
### Setup base model
```php
/* ActiveRelation */
public function getParent() {
[...]
**STEP 2:** Add an attribute _parentName_ to your model _PersonSearch_ and configure your rules.
### Setup search model attributes for search
```php
/* your calculated attribute */
public $parentName;
[...]
**STEP 3:** Edit your _addCondition_ function in the model _PersonSearch_
### Setup search model condition
```php
protected function addCondition($query, $attribute, $partialMatch = false)
{
[...]
**STEP 4:** Configure your gridview columns in your view _index_ file
### Setup view file