I found this method from GridLayout: http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/5.0.0_r1/android/widget/GridLayout.java#GridLayout.spec%28int%2Cfloat%29
So maybe you could try something like this:
((GridLayout.LayoutParams) this.getLayoutParams()).columnSpec =
GridLayout.spec(GridLayout.UNDEFINED, 1f);