after filtering value than enable sorting link on relational field in Grid View

when I first time filter or sort the field of gridview ,after that enable the relational data field sorting link,

so, how can i solve this issue.

here i attached two image that describe the before filtering or sorting and after that.

After do googling i found my mistake.

My mistake was that i added


$dataProvider->sort->attributes[]

code after


$this->load(); 

function; so it mean after loading the filtered data than enable sorting link.

Now, i resolved my mistake with put the


$dataProvider->sort->attributes[]

before


$this->load();

function.