HOW TO AUTO-SIZE CELL IN DATAGRIDVIEW ACCORDING TO DATA SIZE

Takeshi Okada

Total Post:89

Points:629
Posted by  Takeshi Okada
C# 
C#
 1400  View(s)
Ratings:
Rate this:

I searched for Autosizing of cell but found Auto-size row and column how can I make particular cell autosize (in terms of height since column width will be fixed)according to data size of that particular cell? can it be done using some property of datagridview?

  1. Pravesh Singh

    Post:412

    Points:2888
    Re: How to Auto-size cell in datagridview according to data size

    Hi Takeshi,

    This line of code make Cell Auto-size Vertically depending on the data loaded

    dataGridView1.DefaultCellStyle.WrapMode = DataGridViewTriState.True;

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!