.net - Formatted text inside cell on datagridview -
how can display text value of cell format in datagridview?
by example, mi text value displayed this:
date: 05/12/2015
user: username
weight: 5.0
but need in same cell:
date: 05/12/2015
user: username
weight: 5.0
maybe labels inside cell?
thanks!
you can do:
grid.columns("concept").defaultcellstyle.font = new font(grid.font, fontstyle.bold)
where "grid" control datagridview, "concept" columname. if want use colour:
grid.columns("concepto").defaultcellstyle.forecolor = color.maroon
if want change row's default style:
grid.rows(7).defaultcellstyle.backcolor = color.whitesmoke grid.rows(7).defaultcellstyle.font = new font(grid.font, fontstyle.bold) grid.rows(7).defaultcellstyle.forecolor = color.darkslategray
or can change cell's format:
grid.rows(7).cells("concept").style.backcolor = color.aliceblue
you can see msdn - example.
Comments
Post a Comment