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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

DataTable column with very long text

Thread ID:





12423 Mar 30,2004 06:59 AM UTC Mar 30,2004 10:26 AM UTC WinForms 1
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.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon