Forum  General Visual ...  How do I...?  How to set DataGridView cell bold?
Previous Previous
 
Next Next
New Post 11/23/2010 2:14 AM
  AlexanderShatunov
56 posts
No Ranking


How to set DataGridView cell bold? 

 Hi.

Is it possible to set Font.Bold=true to cells in a column of DataGridView? I tried this code:

 

        private void dataGridView1_CellFormatting_1(object sender, DataGridViewCellFormattingEventArgs e)
        {
            var font = e.CellStyle.Font;
            e.CellStyle.Font = new Font(font, FontStyle.Bold);
        }

but it makes bold only column headers. Cell's text is bold only on editing. How to make it bold on viewing too?

 

 
New Post 11/23/2010 5:18 AM
  xCoder
45 posts
No Ranking


Re: How to set DataGridView cell bold? 

Hi Alexander,

try this piece of code:

private void dataGridView1_CellFormatting_1(object sender, DataGridViewCellFormattingEventArgs e)
        {
            var font = e.CellStyle.Font;
            e.CellStyle.Font = new Font(font, System.Drawing.FontStyle.Bold);
        }

 

Hope it helps!

Regards

 
New Post 11/23/2010 6:24 AM
  dror.shahak
302 posts
3rd Level Poster




Re: How to set DataGridView cell bold? 

Hi Alexander,

Please Visual WebGui what version are you using?

I've tested it on the current development version and it works very well. This version will be the official 6.4 release and will be out very soon.

 

Cheers,


Dror Shahak, The Visual WebGui Team
 
New Post 11/23/2010 8:21 PM
  AlexanderShatunov
56 posts
No Ranking


Re: How to set DataGridView cell bold? 
Modified By AlexanderShatunov  on 11/24/2010 8:45:26 AM)

Hi Dror

I use VWG 6.4.0 RC0a.

UPD: In 6.4.0 RC1 work's fine, thanks.

 
New Post 11/24/2010 3:25 PM
  palli
17002 posts
1st Level Poster




Re: How to set DataGridView cell bold? 

Hi Alexander,

Thanks for the confirmation,

Palli

 


Páll Björnsson - Visual WebGui Community Manager - Email: support@visualwebgui.com

Please include VWG version information with your questions (best: Full name of VWG installation .MSI file)
To send sample code or other files to support, first zip the relevant project or files,
then rename .ZIP file to different extension like .XIP and finally email as attachment to email address above.
Remember to include full Http Url to the forum thread in the message.
 
Previous Previous
 
Next Next
  Forum  General Visual ...  How do I...?  How to set DataGridView cell bold?