Wednesday, 18 September 2013

how to position column names vertically in datagridview in vb.net

how to position column names vertically in datagridview in vb.net

I appologise in advance if my question may appear silly to you but I have
a problem with positioning column names in a dataGridview vertically. I'm
populating DataGridView using flowing code:
Dim StrQwery As String = "SELECT * FROM employees WHERE employee_id =
(select MAX(employee_id) FROM employees AND registered = 'UNREGISTERED';
Dim smd As MySqlCommand
smd = New MySqlCommand(StrQwery, myconn)
smd.CommandType = CommandType.Text
Dim da As New MySqlDataAdapter(smd)
Dim cb As New MySqlCommandBuilder(da)
Dim ds As New DataSet()
da.Fill(ds)
GridView1.DataSource = ds.Tables(0)
If n = 1 Then
If Not Page.IsPostBack Then
GridView1.DataBind()
End If
Else
GridView1.DataBind()
End If
everything works perfectly except that I need to position account
attributes like name, position, ID number etc not horizontally but
vertically. Something like this:
|NAME | John |
|SURNAME | Philips|
|POSITION| Manager|
and I can't find a way how to do it. Can anyone give me a hint in my
problem please?
many thanks in advance.

No comments:

Post a Comment