I have to create an ExpandableListView as shown in picture below
I have added GridView inside ExpandableListView but it shows only first line of GridView as you can see in the pic below
GridView is only showing 4 items even though it has total 9 items but that user can see if he scrolls.
Here is the list_item layout in which i defined GridView
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical">
<GridView
android:id="@+id/gvCategories"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:numColumns="4"
android:layout_marginStart="@dimen/margin_xxlarge"
android:layout_marginEnd="@dimen/margin_xxlarge"
android:fillViewport="true"/>
</LinearLayout>
How can I implement it in such a way that GridView doesnt go for scroll and always show all the entries inside it?

I had to create custom class for Gridview like this
then used it in xml like this
and then had to set
isExpandedto true in ExpandableList Adapter (getChildView) like this