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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

DataTable column with very long text

Thread ID:

Created:

Updated:

Platform:

Replies:

12423 Mar 30,2004 06:59 AM UTC Mar 30,2004 10:26 AM UTC WinForms 1
loading
Tags: GridControl
Samuel Jack
Asked On March 30, 2004 06:59 AM UTC

I am using a DataBoundGrid and I have a column which contains some very long text. If I let the Grid do its own thing it just displays this the cells as one very long row of text. The first problem is that the width of the column is much wider than the width of my form (or indeed of my screen). With the Grid behaviour as it is it is impossible to scroll part way along the column - the Grid just jumps to the next column. If I try editing the cell and moving the caret left it just disappears off the screen. So that is my first question: how can I allow the whole of this column to be made visible by scrolling? The second is: what is the best way of limiting the width of the column and making it increase in height instead. Hope you can help. Sam

Administrator [Syncfusion]
Replied On March 30, 2004 10:26 AM UTC

1) This is really not supported. The cell has to be fully visible in order to edit it. The reason is that you cannot clip a EditControl except at its parent window borders. If you have a edit control in the middle of a grid, then you cannot clip it at the edge of its grid cell. You can do some things to be able to scroll the text to see it. Here is a sample that uses covered cells to allow this. forum12423_1005.zip You can also try deriving a cell control that holds a TextBox with a horizontal scrollbar. This solution may also allow you to edit it in a custom TextBox that allows horizontal scrolling using a scrollbar. (Haven''t tried this, so I do not know what problems you may encounter.) 2) Go ahead and set the colwidth for the column to be the desired width you want it to be (preferably something less than the clientwidth of the grid so you can edit it). Also, make sure the style for the column has WrapText = true set. The if you call grid.Model.RowHeights.ResizeToFit passing it the column range, it should resize the row heights to make everything visible.

CONFIRMATION

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.

Warning Icon 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.Close Icon

;