TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Tony Allan
NA
71
10.2k
Resize the font in a datagrid cell so it fits the cell.
Nov 19 2019 11:56 AM
In this example I have a simple DataTable with headings, 3 column and 2 Rows of data. Bound to datatable 1 (dt1). What I wish to do is have the font size of each cell to adjust to fill the cell width. No word wrapping or use of viewbox as they do not suit the overall application. I have used viewbox on the last column to demonstrate the viewbox behaviour I wish to escape. It reduces the area of the textbox in the cell meaning that you have to click exactly on the text in order to edit the cell. The behaviour I am looking for is to adjust the font size (doesn't matter how small it gets as in the final implementation the user can adjust the width of the column and so increase the font to a readable size) to fit the cell width on one line. The font size just needs to adjust to the width of the cell so as to fit in the cell no matter how small the font may become. Thank you Tony.
Attachment:
C#AndXAML.zip
Reply
Answers (
2
)
I got response.StatusCode as 'forbidden'
How to select data from DataGrid in WPF MVVM with database