Link to home
Start Free TrialLog in
Avatar of demoniumz
demoniumz

asked on

datagrid view properties

hello i  use datagrid in a form and i want 1) to move the fields in the above photo in the center 2) put a color behind the fields 3) minus the font of the fields.How i  can do these

i am using vb 2005

Thnks for the help
untitled.PNG
Avatar of demoniumz
demoniumz

ASKER

anyone to help pls
HELLO
ASKER CERTIFIED SOLUTION
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
center not work  can  i move  the space between  each field  to be more nice  

example ok (these i need to appear)
Categor Name !Category ident

not  like these (appear now)
Categories Name !    Category ident    !      picture !
 
Can you show a picture ?
Just note that it will not be correctly center because some space on the right are reserved to the sort arrows. If you don't need to sort you can remove it that option and the text will be correctly at the center.
What jpaulino is saying is that, for instance, use this to center the header text:

Me.DataGridView1.RowHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter

and on the columns that you don't need to sort ascending or descending, to remove the sort glyph (the small triangle that appears on the header, right of the header text), use this for each column:

Me.DataGridView1.Columns("CategoryName").SortMode = DataGridViewColumnSortMode.NotSortable

this will remove the sort glyph and allow the text to be sorted right on the middle of the column header.

jppinto

Check the picture of this post to see if this is what you're getting on the headers texts:

https://www.experts-exchange.com/questions/24303598/DataGridView-Header-text-not-centered.html

with my previous post, you will be able to solve the problem as I solved mine.

jppinto