Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm Controls / January 2007

Tip: Looking for answers? Try searching our database.

DataGridView editing bug (changing Form's font)?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paolo Pagano - 29 Jan 2007 10:36 GMT
I have a simple Form with a DataGridView; in VS2005 designer I
change the Form's font size to  9, 10 (or more) points.

When editing a text cell the TextBox editing control seems not have
sufficient height: characters like 'g' are bottom cutted and text is
not full visible!

Is DataGridView text editing "Microsoft Sans Serif; 8,25pt" only "oriented",
or am I missing something?

thanks
RobinS - 30 Jan 2007 00:21 GMT
Did you also change the DataGridView's font property?

Robin S.
-----------------------------------
>I have a simple Form with a DataGridView; in VS2005 designer I
> change the Form's font size to  9, 10 (or more) points.
[quoted text clipped - 8 lines]
>
> thanks
Paolo Pagano - 30 Jan 2007 08:04 GMT
Yes, the problem remains!

The strange thing is that some Fonts (like Microsoft Sans Serif) suffer this
problem, other (like Tahoma) no. I expect a controls like DataGridView
are Font safe (and agnostic too).

In a real application where user can choose the font she/hr likes, this is a
problem!

Any workaroud?

> Did you also change the DataGridView's font property?
>
> Robin S.
ClayB - 30 Jan 2007 11:38 GMT
One thing you can try is, in Form.Load (or anytime after the font was
resized), to call:

               this.dataGridView1.AutoResizeRows();

=====================
Clay Burch
Syncfusion, Inc.
Paolo Pagano - 30 Jan 2007 12:24 GMT
done... the problem is still there! it is not a cell painting problem, but
an editing one;

I found that forcing  (e.s. in the 'EditingControlShowing' event)

   ( (TextBox) (  dataGridView1.EditingControl  ) ).AutoSize = false;

seems to be a workaround, but I'd prefer not modify the DataGridView
positioning/sizing  text editing preconditions (I have manually calculate
the right Height);

this is the same problem of TextBox'es with BorderStyle None: increase the
font
(at least Microsoft Sans Serif) and Text like "gggg" is not full visible;
you can change the
AutoSize property to false and solve the problem, but you loose the "auto
Height sizing"...

Summing up it seems a TextBox problem (from which
"DataGridViewTextBoxEditingControl" derives),
a bug with some fonts when BorderStyle is None

> One thing you can try is, in Form.Load (or anytime after the font was
> resized), to call:
>
>                this.dataGridView1.AutoResizeRows();

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.