I want to show some text inside the MemoEdit in two columns. The parse of the text works correctly because when I see the parsed text inside Notepad or when I debug it inside Visual Studio it shows it in two columns, so the text is formatted exactly in the way I need it. The problem is that when it is shown inside the MemoEdit, it doesn't keep the format (I think this is because it uses a different font for the text, not a fixed size width font, because white spaces are smaller then normal characters). I changed the font to some fixed size width font and is showing it correctly, but the problem is that I need to have the same font like the application uses. Is there any property on MemoEdit that can help me achive the behavior I want without changing the font?
Thanks a lot!
You can activate the RowAutoHeight option of the GridView.OptionsView property in GUI and you can set it pragmatically as below:
gridView1.OptionsView.RowAutoHeight = true;
You can also use CalcRowHeight event handler to tweak the height of the gridview rows. check the reference links.
Reference these DevExpress fourm thread -
Auto-height of grid rows and text WordWrap
GridControl row height (cell height)
Changing row height at runtime
Related
I am using the standard textbox control on a Windows form. I want to display the text VERTICALLY rather than horizontally. To accomplish this I set the multiline property to true, the TextAligh property to center and used the lines property to input each character as a separate array element. So far, so good.
I see the text displayed the way I want but would like to reduce the vertical spacing between lines without reducing the font size. Can it be done? If so, how?
It can be done, but not by the default options on a standard textbox.
You would probably need to override the Paint event and draw the text yourself, but it would get very ugly, and would essentially be reinventing the standard Paint method.
What criteria must I consider when selecting one of these two controls?
Common to both TextBlocks and TextBoxes:
Can be used to display text
Can be set to specific Height and Width or be set to Auto so that they grow in size with the text.
Can set font size, font type, font styling, to wrap and to range left, right or centred.
Can have opacity set and have Pixel Shaders applied.
TextBlock:
Used for displaying text more focused typographically.
Can contain text set to different colors, fonts and sizes.
The line height can also be increased from the default setting to give more space between each line of text.
Text inside a TextBlock cannot be made selectable by the user.
TextBox:
Used for displaying text more focused for content input or when content is needed to be made selectable by the user.
Can only be set to one colour, one font size, one font type etc.
Have fixed Line Spacing.
Can also be set to a fixed height and width but also have scrollbars switched on to allow content to expand.
TextBlock is more lightweight control for displaying text and TextBox is used when you require user input or edit existing text. Proof for mem usage.
I need to display data in the UI in a table format. I am using wpf (MVVM), VS 2010 and windows XP. I do not want to use the DataGrid or ListView. How can I achieve this?
What I have tried
Method 1:
I tried to use SharedSizeGroup but that didn't work. The main problem with using SharedSizeGroup is that even the row height is shared among all rows.
Method 2:
I tried to use UniformGrid but I was not completely successful. Using UniformGrid will not suite my application because each column data is of different width and I do not want each column to take the same width as the Max of all!
Can anyone please tell me how to use the normal grid to get the desired result? Is there any way to use SharedSizeGroup so that only the column width is shared but not the row height and each row occupies only desired space (i.e. same behavior as setting the height to auto) but not more than that?
Additional information: This grid has to be read-only and no row should be selectable in the UI.
I have a datagrid in my application (WPF environment) to load data into it.
Row header in my app have row number in it (just like excel).
Now my problem is when I have 99 rows, the width of row header is correct but when it is more than that rowheader width is too small and cuts the number (see the picture). I want to set rowheaderwidth to auto but there is no in-built command for that.any ideas? thanks for the help
You should write your own DatagridRowHeaderTemplate.
See this link: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/62e7b57d-b83f-4d25-bdb4-89b55f383bca/
According to the DataGrid.RowHeaderWidth Property documentation:
Set this property to NaN to make the row header automatically adjust its size to fit its content.
The following works as documented.
<DataGrid RowHeaderWidth="NaN"/>
I want my RichtextBox to enable line spacing chosen by user (multiplier of 1, 1.5 or 2). I tried to programatically change LineHeight of paragraphs, setting it to FontSize*multiplier. That works fine, but it can't be used for different fontSizes in the same paragraph, because then I have to choose one of the sizes for the calculation of LineHeight.
I would like to have it similar like in WordPad or OpenOffice, where the actual LineHeight is calculated for each line using the biggest fontSize used on the line.
Is there any possibility to change the LineHeight for lines or to tell the RichTextBox to just use the multiplier? Or any other solution?
I think you are looking for the LineStackingStrategy="MaxHeight" for the Blocks. See this page: http://msdn.microsoft.com/en-us/library/system.windows.documents.block.linestackingstrategy.aspx