473,811 Members | 3,264 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Wrapping text in DataGridTextBox Column

I have a datagrid column which I want to expand when i type in some text. Initially I tried increasing the column width on the key down event of that DataGridTextBox Column, but it didn't work out as expected. Now, I am trying to increase the height of the row to make it as a multiline column.

private DataGridTextBox Column dgcComments
dgcComments = new DataGridTextBox Column()
dgcComments.Tex tBox.Multiline = true
dgcComments.Tex tBox.AcceptsRet urn = true
dgcComments.Tex tBox.WordWrap = true

I am able to increase the row height, but the text is not wrapping to fit the row height. The text keeps scrolling to the left in a single line. I have set the WordWrap property to True and Multiline property to True, but it doesn't seem to work. Another thing that I tried is to display a vertical scroll bar, but that also fails to meet the reqmt. Anybody has any idea how to wrap text in a text box column of datagrid
Sangeetha

Nov 16 '05 #1
1 8773
The TextBox itself is only used when a cell in the column is being edited.
For displaying data, the PaintText method of the DataGridTextBox Column is
used. Therefore, the first thing to try is to start editing some cell and to
ensure the hosted TextBox instance is indeed multi-line. Then, override the
PaintText method (or the Paint method if the former is not virtual) and
provide your own drawing code which will allow for line wraps.

"Sangeetha" <an*******@disc ussions.microso ft.com> wrote in message
news:9A******** *************** ***********@mic rosoft.com...
I have a datagrid column which I want to expand when i type in some text. Initially I tried increasing the column width on the key down event of that
DataGridTextBox Column, but it didn't work out as expected. Now, I am trying
to increase the height of the row to make it as a multiline column.
private DataGridTextBox Column dgcComments;
dgcComments = new DataGridTextBox Column();
dgcComments.Tex tBox.Multiline = true;
dgcComments.Tex tBox.AcceptsRet urn = true;
dgcComments.Tex tBox.WordWrap = true;

I am able to increase the row height, but the text is not wrapping to fit the row height. The text keeps scrolling to the left in a single line. I
have set the WordWrap property to True and Multiline property to True, but
it doesn't seem to work. Another thing that I tried is to display a vertical
scroll bar, but that also fails to meet the reqmt. Anybody has any idea how
to wrap text in a text box column of datagrid ? Sangeetha.


Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1491
by: DraguVaso | last post by:
Hi, I need to know the Lenght of the Text in a DataGridTextBoxColumn when I move with the mouse over it, and show it in a ToolTip. I have something that works, but it works only when the DataGridextBoxColumn is not selected. Once I select it (type some additional text in it), I don't see the ToolTip anymore... I gues that's because it isn't anymore the DataGrid that the Mouse is moving over, but the Cell. Does anybody knows a solution...
3
7169
by: Randy | last post by:
Hello, How would this be done? I've looked at the datagrid itself and also the tableStyle and can't find out how to make text wrap in a cell. Thanks
1
1948
by: Jaco Karsten | last post by:
I am writing a customized DataGrid control which will allow the user to only select an entire row (and not a cell inside the row). So I want to add readonly columns to the datagrid. To achieve this, instead of using a "DataGridTextBoxColumn" inside the datagrid I want the control to use a "DataGridTextBoxColumn" that has a disabled "Edit" method. Therefor I have created my own version of a "DataGridTextBoxColumn" class called...
3
1436
by: PawelR | last post by:
Hi, I use dataGrid to show data from DataBase. In one table I've text field (varchar 2048) and data in this field is very long (more characters). How show this text in datagrid as multiline or which component use to show multiline date. Thx PawelR
1
1238
by: neil rowe | last post by:
Hi all How do I trap the click event of a standard datagrid text box column on a windows form ? Regards Neil
2
1284
by: Mr.D | last post by:
I know that it is possible to do this: MsgBox(DataGrid1.Item(rowIndex, columnIndex)) However my data has several columns wich I dont controll. Ex: Name, Adress, Favorite Food in different orders. So how do I select column by Text instead of number? EX: DataGrid1.Item(rowIndex, DataGrid1.Column("Adress") Hope that I made myself understandable ;)
9
1419
by: Siv | last post by:
Hi, I am trying to find a wrapping routine for text and not having much luck. The reason I need one is that I am producing a report where the text that was stored in the database was written into a multi-line text box, so it contains long strings of text where the user allowed the wrapping of the text box to wrap the text within its confines and here and there, they will have entered CRLFs where they have pressed ENTER to push in a break...
6
1165
by: Markus Ernst | last post by:
Hi Searching for a possibility to display some text with preserved white space and line breaks, but with long lines being wrapped, I found this CSS declaration, which I found helpful: pre { white-space: pre-wrap; /* css-3 */ white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ white-space: -pre-wrap; /* Opera 4-6 */
6
5177
by: Greg Esres | last post by:
I have some text lines to print that are much longer than the width of the paper, maybe as much as 6 times. For a given page, I'd like everything that doesn't fit to print on a second page, and whatever doesn't fit there to go on a third page, etc, so that I can piece together the final output by laying the pages side by side. Things that don't work well: 1) Breaking up the line into sections of a given # of characters. Problem with...
0
9727
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10386
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10133
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9204
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7669
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6889
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4339
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3017
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.