how to set gridview.Column

Post

Posted
Rating:
#1 (In Topic #317)
Regular
bill-lancaster is in the usergroup ‘Regular’
 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
Online now: No Back to the top

Post

Posted
Rating:
#2
Avatar
Guru
cogier is in the usergroup ‘Guru’
 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
Online now: No Back to the top

Post

Posted
Rating:
#3
Regular
bill-lancaster is in the usergroup ‘Regular’
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:-

Code

Public Sub Button1_Click()
  GridView1.Column = 2
  Print "CC";; GridView1.Column

End
is where the problem is.
Online now: No Back to the top

Post

Posted
Rating:
#4
Regular
bill-lancaster is in the usergroup ‘Regular’
 GridView1.Columns.Sort = 2
does it.
Regards
Online now: No Back to the top
1 guest and 0 members have just viewed this.