I must be missing something here!
I want to set the column from code.
GridView1.Column = 2
But Print GridView1.Column shows "-1"
Any ideas welcome
how to set gridview.Column
-
- Posts: 195
- Joined: Tuesday 26th September 2017 3:17pm
- Location: NW England
- cogier
- Site Admin
- Posts: 1125
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: how to set gridview.Column
Hi Bill.
You need Gridview1. Columns. Count = 2.
And a useful trick to use after you have filled your Gridview is to auto arrange the Columns widths with: -
Gridview1. Columns. Width = - 1
You need Gridview1. Columns. Count = 2.
And a useful trick to use after you have filled your Gridview is to auto arrange the Columns widths with: -
Gridview1. Columns. Width = - 1
-
- Posts: 195
- Joined: Tuesday 26th September 2017 3:17pm
- Location: NW England
Re: how to set gridview.Column
Thanks for the quick response.
I have already set up the table with GridView1.Columns.Count = 3 and filled the table with data.
I'm using the _Sort event but would like to force the sorting of a column from code. So after setting up the gridview:-
is where the problem is.
I have already set up the table with GridView1.Columns.Count = 3 and filled the table with data.
I'm using the _Sort event but would like to force the sorting of a column from code. So after setting up the gridview:-
Code: Select all
Public Sub Button1_Click()
GridView1.Column = 2
Print "CC";; GridView1.Column
End
-
- Posts: 195
- Joined: Tuesday 26th September 2017 3:17pm
- Location: NW England
Re: how to set gridview.Column
GridView1.Columns.Sort = 2
does it.
Regards
does it.
Regards