473,324 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

problem with text in DataGrid

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
Nov 16 '05 #1
3 1404
PawelR,

You might want to get the DataGridTextBoxColumn instance that represents
the column being shown. Once you do that, you should get the TextBox
returned by the TextBox property. On that, you should set the Multiline
property to true. This should allow the text to wrap in the box when you
change the height of the rows.

However, the default height for the textbox will remain the same. If
you want to change this, then you will need to derive a class from
DataGridTextBoxColumn and override the GetMinimumHeight method to return a
larger height (right now it bases that height on the font height).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"PawelR" <pa************@poczta.onet.pl> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
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

Nov 16 '05 #2
Thx Nicholas,
Write me please how get the TextBox returned by the TextBox property. In
DataGridTextBoxColumn, I don't find TextBox property. Please write me sample
source code.

PawelR

Użytkownik "Nicholas Paldino [.NET/C# MVP]"
<mv*@spam.guard.caspershouse.com> napisał w wiadomości
news:Ok**************@TK2MSFTNGP09.phx.gbl...
PawelR,

You might want to get the DataGridTextBoxColumn instance that represents the column being shown. Once you do that, you should get the TextBox
returned by the TextBox property. On that, you should set the Multiline
property to true. This should allow the text to wrap in the box when you
change the height of the rows.

However, the default height for the textbox will remain the same. If
you want to change this, then you will need to derive a class from
DataGridTextBoxColumn and override the GetMinimumHeight method to return a
larger height (right now it bases that height on the font height).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"PawelR" <pa************@poczta.onet.pl> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
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


Nov 16 '05 #3
PawelR,

When you get the DataGridColumnStyle, cast it to an instance of
DataGridTextBox column, and then access the TextBox property.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"PawelR" <pa************@poczta.onet.pl> wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl...
Thx Nicholas,
Write me please how get the TextBox returned by the TextBox property. In
DataGridTextBoxColumn, I don't find TextBox property. Please write me
sample
source code.

PawelR

Użytkownik "Nicholas Paldino [.NET/C# MVP]"
<mv*@spam.guard.caspershouse.com> napisał w wiadomości
news:Ok**************@TK2MSFTNGP09.phx.gbl...
PawelR,

You might want to get the DataGridTextBoxColumn instance that

represents
the column being shown. Once you do that, you should get the TextBox
returned by the TextBox property. On that, you should set the Multiline
property to true. This should allow the text to wrap in the box when you
change the height of the rows.

However, the default height for the textbox will remain the same. If
you want to change this, then you will need to derive a class from
DataGridTextBoxColumn and override the GetMinimumHeight method to return
a
larger height (right now it bases that height on the font height).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"PawelR" <pa************@poczta.onet.pl> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
> 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
>
>



Nov 16 '05 #4

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

Similar topics

1
by: Stephen | last post by:
I have a really annoying problem with a datagrid. I have an application which populates a datagrid on the onclick event of a button. The datagrid is bound to an ArrayList which holds the values. ...
1
by: Amadelle | last post by:
Hi all and thanks in advance for your help, I have a problem with capturing the changed value of a text box in a datagrid. The datagrid is populated based on a dataset and I am using template...
1
by: Joe Bloggs | last post by:
I am trying display the contents of a table in a web page, select certain rows from that table and then display the fields that I have selected (now table columns) as text in a Label object....
5
by: Jeff | last post by:
IDE: VS 2003 :NET OS: XP Pro My app have a form with a tab-control on it. The tab-control have 2 tabpages. One of the tabpages displays a datagrid, and the other tabpage displays details (order...
4
by: Stephen | last post by:
I have the following code working in order to create an array list and populate a datagrid however everytime i click my button the first item in the array and the first row in the datagrid are...
8
by: Inigo Jimenez | last post by:
I have an ASP .net web application installed in a Windows 2003 server. This web application has a webform that has a Datagrid. This Datagrid is filled with the data of a SQL table. I have a...
5
by: junglist | last post by:
Hi guys, I've been trying to implement an editable datagrid and i have been succesful up to the point where i can update my datagrid row by row. However what used to happen was that once i updated...
9
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the...
1
by: Brock | last post by:
Thanks in advance... (you can see a screenshot of what my form looks like currently at http://www.juggernautical.com/DataGrid.jpg - the Datalist is super-imposed in 'design view' but the DataGrid...
2
by: =?Utf-8?B?Y3JlYXZlczA2MjI=?= | last post by:
I have a nested datagrid in a xaml file, the parent datagrid loads the vendor information and the details loads the documents for that vendor in a datagrid. Everything is working fine until I click...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shćllîpôpď 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.