We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Text wrapping

Thread ID:





31887 Jul 18,2005 06:43 AM Jul 29,2005 06:39 AM Windows Forms 2
Tags: GridControl
Mike Woolley
Asked On July 18, 2005 06:43 AM

Hi, I''m using a textbox in a cell to edit data. The default behaviour is that the textbox will scroll if the user enters text that exceeds the current width. Rather than scrolling, I would like to detect when I need more space and increase the row height so that the text spans multiple lines (and conversely, decrease if text is subsequently deleted). Any ideas as to how I could do this?

Administrator [Syncfusion]
Replied On July 18, 2005 07:02 AM

If you set style.TextWrap = true and style.AutoSize = true for the cell, then as you user types, the height of the cell should increase. But it will not decrease dynamically. If you want to shrink the cell as your user leaves it, then you could handle CurrentCellMoved, and there call grid.Model.Rowheights.ResizeToFit passing in a GridRangeInfo object holding the cell that you can get from grid.CurrentCell.MoverFromRowIndex/ColIndex.

Replied On July 29, 2005 06:39 AM

style.TextWrap property doesn''t exist, try style.WrapText


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.