473,511 Members | 15,624 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataGrid word wrap

Hi,
I wand display in dataGrid (winform application) column with multiline
TextBox. In source code I've function:
private void DGFormat()
{
DataGridTableStyle myStyle = new DataGridTableStyle();
DataGridColumnStyle kKontroler = new DataGridTextBoxColumn();
kKontroler.MappingName = "uiName";
kKontroler.Alignment = HorizontalAlignment.Left;
kKontroler.Width = 120;
kKontroler.HeaderText = @"Name";

DataGridTextBoxColumn tbc = new DataGridTextBoxColumn();
tbc.MappingName = "Description";
tbc.HeaderText = "My Description";
tbc.TextBox.Multiline = true;
tbc.TextBox.WordWrap = true;
tbc.Width = 50;
tbc.TextBox.WordWrap = true;

DataGridColumnStyle[] columnRange = { kKontroler,tbc};

myStyle.MappingName = "People";
myStyle.GridColumnStyles.AddRange(columnRange);
myStyle.ForeColor = Color.Navy;
myStyle.BackColor = Color.LightSteelBlue;
dataGrid1.TableStyles.Add(myStyle);
}
If I use this function dataGrid have new format but not have column with
word wrap, multiline. What is not correct. Please help me,
Thx Pawel

Nov 16 '05 #1
0 2656

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

Similar topics

1
1979
by: Stephen | last post by:
I have a datagrid and i'm trying to fix the width of one of the columns to be exactly 300px. My problem is that one of the records fields(CompanyName) is really long and has no spaces so it...
1
3518
by: Bernerd | last post by:
Would anyone out there tell me how to make my C# datagrid wrap the text in the cells. I haven't seen a good how to out there that does this. I know it has something to do with using styles but...
1
5281
by: Craig Banks | last post by:
If a row of data in a dataset has a lot of columns the row displaying the data in a datagrid will run way off the screen. What I'd like to do is display a row of data over several datagrid rows so...
2
3662
by: Luis Esteban Valencia Muñoz | last post by:
I have a datagrid that displays editable text fields (2 different price fields) and a checkbox in every row. It has a "SaveChanges" button at the bottom, which, when pressed, looks at every...
0
4011
by: Wyatt70 | last post by:
I'm attempting to implement a javascript popup calendar in a DataGrid. The calendar will be used to insert a date into a textbox. I keep getting a "System.NullReferenceException: Object reference...
1
2272
by: kpg | last post by:
Hi All, me again. I've got my web form data grid set up pretty nice. But how do you set the column width? The columns seem to grow and shrink based on the width of the data in them (that's ok)...
0
1926
by: virendra.chandra | last post by:
in datagrid cellpadding is not working. can u suggest what could be the possible error. this is my code <asp:datagrid id="test1" Runat="server" Width="700" Enabled="True"...
2
1973
by: TB | last post by:
According to Microsoft ( http://support.microsoft.com/default.aspx?scid=kb;EN-US;323169 ), there is bug in the the datagrid control, causing content to wrap in the columns of a datagrid eventhough...
3
1952
by: Alex Maghen | last post by:
Hi. Is there any way to lock down the width of columns in a DataGrid so that even if the text in one of the rows of that column is very wide, it just gets cut off or something rather than causing...
0
7153
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...
0
7371
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7432
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...
1
5077
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...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1583
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 ...
1
791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
452
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...

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.