473,405 Members | 2,272 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,405 software developers and data experts.

Datagrid Truncates Data?

I am using a datagrid to display some data. I notice when
I click in a cell where the data is longer than the cell
width, it truncates the end of the data off.

For example:

The data is:
This is sample data

Column only has room for:
This is sample da

When I click in the cell, it changes to:
This is sample

When I leave the cell, it changes back to:
This is sample da

Is this a property of the DataGridTableStyle? Can I fix it
so that when I click in the cell, all the data is there if
I right arrow over? Thanks.

Sean
Nov 20 '05 #1
9 1524
Erm, this is a thorny issue. Basically there is no AutoWidth facility. You
need to measure the text you have in there and set the column width to be
wide enough to display it. It's cr*p I know.

But, there are third party grids out there which do this sort of thing.

Regards - OHM
Sean wrote:
I am using a datagrid to display some data. I notice when
I click in a cell where the data is longer than the cell
width, it truncates the end of the data off.

For example:

The data is:
This is sample data

Column only has room for:
This is sample da

When I click in the cell, it changes to:
This is sample

When I leave the cell, it changes back to:
This is sample da

Is this a property of the DataGridTableStyle? Can I fix it
so that when I click in the cell, all the data is there if
I right arrow over? Thanks.

Sean


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com
Nov 20 '05 #2
Mr.Ken Tucker taught about allowing word wrap to occur inside a cell. Since
doing this, I have not had these issues.

If he does not respond I will see if I can dig it up from memory.

"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Erm, this is a thorny issue. Basically there is no AutoWidth facility. You
need to measure the text you have in there and set the column width to be
wide enough to display it. It's cr*p I know.

But, there are third party grids out there which do this sort of thing.

Regards - OHM
Sean wrote:
I am using a datagrid to display some data. I notice when
I click in a cell where the data is longer than the cell
width, it truncates the end of the data off.

For example:

The data is:
This is sample data

Column only has room for:
This is sample da

When I click in the cell, it changes to:
This is sample

When I leave the cell, it changes back to:
This is sample da

Is this a property of the DataGridTableStyle? Can I fix it
so that when I click in the cell, all the data is there if
I right arrow over? Thanks.

Sean


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com

Nov 20 '05 #3
Useful, yes, but this is not the answer really is it. If you were using a
spreadsheet, you would not necessarily want wrapping to happen. The OP wants
truncation to stop, not wrapping to begin. ( At least I think as much ).

Regards - OHM

scorpion53061 wrote:
Mr.Ken Tucker taught about allowing word wrap to occur inside a cell.
Since doing this, I have not had these issues.

If he does not respond I will see if I can dig it up from memory.

"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote in
message news:%2****************@TK2MSFTNGP09.phx.gbl...
Erm, this is a thorny issue. Basically there is no AutoWidth
facility. You need to measure the text you have in there and set the
column width to be wide enough to display it. It's cr*p I know.

But, there are third party grids out there which do this sort of
thing.

Regards - OHM
Sean wrote:
I am using a datagrid to display some data. I notice when
I click in a cell where the data is longer than the cell
width, it truncates the end of the data off.

For example:

The data is:
This is sample data

Column only has room for:
This is sample da

When I click in the cell, it changes to:
This is sample

When I leave the cell, it changes back to:
This is sample da

Is this a property of the DataGridTableStyle? Can I fix it
so that when I click in the cell, all the data is there if
I right arrow over? Thanks.

Sean


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com
Nov 20 '05 #4
I am wondering if the truncation is occuring at the database level or if
somehow the code iteself is truncating the data. For instance if the dataset
field has a max of 50 chararacters and the database has a max of 100 the
grid will cut off the 50 the database tries to deliver.

I may be wrong though because now that I think about it it should throw a
concurrency error.

"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote in message
news:Ol**************@tk2msftngp13.phx.gbl...
Useful, yes, but this is not the answer really is it. If you were using a spreadsheet, you would not necessarily want wrapping to happen. The OP wants truncation to stop, not wrapping to begin. ( At least I think as much ).

Regards - OHM

scorpion53061 wrote:
Mr.Ken Tucker taught about allowing word wrap to occur inside a cell.
Since doing this, I have not had these issues.

If he does not respond I will see if I can dig it up from memory.

"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote in
message news:%2****************@TK2MSFTNGP09.phx.gbl...
Erm, this is a thorny issue. Basically there is no AutoWidth
facility. You need to measure the text you have in there and set the
column width to be wide enough to display it. It's cr*p I know.

But, there are third party grids out there which do this sort of
thing.

Regards - OHM
Sean wrote:
I am using a datagrid to display some data. I notice when
I click in a cell where the data is longer than the cell
width, it truncates the end of the data off.

For example:

The data is:
This is sample data

Column only has room for:
This is sample da

When I click in the cell, it changes to:
This is sample

When I leave the cell, it changes back to:
This is sample da

Is this a property of the DataGridTableStyle? Can I fix it
so that when I click in the cell, all the data is there if
I right arrow over? Thanks.

Sean

--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com

Nov 20 '05 #5
The data is correct in the database. The truncation seems
to be to the nearest full word at the physical level, and
only while the cell is selected.

For example, If my data was:

Alpha ABCDEFGHIJKLMNOPQRSTUVWXYZ

And only this much fits physically in the grid cell:

Alpha ABCDEFGHIJKLMNOPQRSTUVW

When I click in the cell I get:

Alpha

And when I click off again I get:

Alpha ABCDEFGHIJKLMNOPQRSTUVW

-----Original Message-----
I am wondering if the truncation is occuring at the database level or ifsomehow the code iteself is truncating the data. For instance if the datasetfield has a max of 50 chararacters and the database has a max of 100 thegrid will cut off the 50 the database tries to deliver.

I may be wrong though because now that I think about it it should throw aconcurrency error.

"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote in messagenews:Ol**************@tk2msftngp13.phx.gbl...
Useful, yes, but this is not the answer really is it. If you were using
a
spreadsheet, you would not necessarily want wrapping to
happen. The OPwants
truncation to stop, not wrapping to begin. ( At least I

think as much ).
Regards - OHM

scorpion53061 wrote:
> Mr.Ken Tucker taught about allowing word wrap to occur inside a cell. > Since doing this, I have not had these issues.
>
> If he does not respond I will see if I can dig it up from memory. >
> "One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot} com> wrote in > message news:% 23***************@TK2MSFTNGP09.phx.gbl... >> Erm, this is a thorny issue. Basically there is no AutoWidth >> facility. You need to measure the text you have in there and set the >> column width to be wide enough to display it. It's cr*p I know. >>
>> But, there are third party grids out there which do this sort of >> thing.
>>
>> Regards - OHM
>>
>>
>> Sean wrote:
>>> I am using a datagrid to display some data. I notice when >>> I click in a cell where the data is longer than the cell >>> width, it truncates the end of the data off.
>>>
>>> For example:
>>>
>>> The data is:
>>> This is sample data
>>>
>>> Column only has room for:
>>> This is sample da
>>>
>>> When I click in the cell, it changes to:
>>> This is sample
>>>
>>> When I leave the cell, it changes back to:
>>> This is sample da
>>>
>>> Is this a property of the DataGridTableStyle? Can I fix it >>> so that when I click in the cell, all the data is there if >>> I right arrow over? Thanks.
>>>
>>> Sean
>>
>> --
>> Best Regards - OHM
>>
>> O_H_M{at}BTInternet{dot}com


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com

.

Nov 20 '05 #6
The reason for this is that when you edit a cell, it puts an edit box over
the cell you are editing. When you are not, it resorts to the column width.
You need to use styles for the column and measure the width of the text.

This is a common topic on the web. Use google to find something suitable.
Regards - OHM
Sean wrote:
The data is correct in the database. The truncation seems
to be to the nearest full word at the physical level, and
only while the cell is selected.

For example, If my data was:

Alpha ABCDEFGHIJKLMNOPQRSTUVWXYZ

And only this much fits physically in the grid cell:

Alpha ABCDEFGHIJKLMNOPQRSTUVW

When I click in the cell I get:

Alpha

And when I click off again I get:

Alpha ABCDEFGHIJKLMNOPQRSTUVW

-----Original Message-----
I am wondering if the truncation is occuring at the database level
or if somehow the code iteself is truncating the data. For instance
if the dataset field has a max of 50 chararacters and the database
has a max of 100 the grid will cut off the 50 the database tries to
deliver.

I may be wrong though because now that I think about it it should
throw a concurrency error.

"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote in
message news:Ol**************@tk2msftngp13.phx.gbl...
Useful, yes, but this is not the answer really is it. If you were
using a spreadsheet, you would not necessarily want wrapping to
happen. The OP wants truncation to stop, not wrapping to begin. (
At least I think as much ).

Regards - OHM

scorpion53061 wrote:
Mr.Ken Tucker taught about allowing word wrap to occur inside a
cell. Since doing this, I have not had these issues.

If he does not respond I will see if I can dig it up from memory.

"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot} com> wrote in
message news:% 23***************@TK2MSFTNGP09.phx.gbl...> Erm, this is a thorny issue. Basically there is no AutoWidth
> facility. You need to measure the text you have in there and set
> the column width to be wide enough to display it. It's cr*p I
> know.
>
> But, there are third party grids out there which do this sort of
> thing.
>
> Regards - OHM
>
>
> Sean wrote:
>> I am using a datagrid to display some data. I notice when
>> I click in a cell where the data is longer than the cell
>> width, it truncates the end of the data off.
>>
>> For example:
>>
>> The data is:
>> This is sample data
>>
>> Column only has room for:
>> This is sample da
>>
>> When I click in the cell, it changes to:
>> This is sample
>>
>> When I leave the cell, it changes back to:
>> This is sample da
>>
>> Is this a property of the DataGridTableStyle? Can I fix it
>> so that when I click in the cell, all the data is there if
>> I right arrow over? Thanks.
>>
>> Sean
>
> --
> Best Regards - OHM
>
> O_H_M{at}BTInternet{dot}com

--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com

.


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com
Nov 20 '05 #7
Hi,

Here is a link to some datagrid columns I been working on. There is
a multiline column which will automatically adjust the row height in there.

http://www.onteorasoftware.com/downl...lesexample.zip

Ken
-------------------------
"Sean" <an*******@discussions.microsoft.com> wrote in message
news:06****************************@phx.gbl...
I am using a datagrid to display some data. I notice when
I click in a cell where the data is longer than the cell
width, it truncates the end of the data off.

For example:

The data is:
This is sample data

Column only has room for:
This is sample da

When I click in the cell, it changes to:
This is sample

When I leave the cell, it changes back to:
This is sample da

Is this a property of the DataGridTableStyle? Can I fix it
so that when I click in the cell, all the data is there if
I right arrow over? Thanks.

Sean

Nov 20 '05 #8
Hi Ken,
I have not visited the link yet, but does this also deal with
auto column width ?

Regards - OHM

Ken Tucker [MVP] wrote:
Hi,

Here is a link to some datagrid columns I been working on.
There is a multiline column which will automatically adjust the row
height in there.

http://www.onteorasoftware.com/downl...lesexample.zip

Ken
-------------------------
"Sean" <an*******@discussions.microsoft.com> wrote in message
news:06****************************@phx.gbl...
I am using a datagrid to display some data. I notice when
I click in a cell where the data is longer than the cell
width, it truncates the end of the data off.

For example:

The data is:
This is sample data

Column only has room for:
This is sample da

When I click in the cell, it changes to:
This is sample

When I leave the cell, it changes back to:
This is sample da

Is this a property of the DataGridTableStyle? Can I fix it
so that when I click in the cell, all the data is there if
I right arrow over? Thanks.

Sean


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com
Nov 20 '05 #9
Hi,

Not yet.

Ken
--------------------
"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote in message
news:uz*************@tk2msftngp13.phx.gbl...
Hi Ken,
I have not visited the link yet, but does this also deal with
auto column width ?

Regards - OHM

Ken Tucker [MVP] wrote:
Hi,

Here is a link to some datagrid columns I been working on.
There is a multiline column which will automatically adjust the row
height in there.

http://www.onteorasoftware.com/downl...lesexample.zip

Ken
-------------------------
"Sean" <an*******@discussions.microsoft.com> wrote in message
news:06****************************@phx.gbl...
I am using a datagrid to display some data. I notice when
I click in a cell where the data is longer than the cell
width, it truncates the end of the data off.

For example:

The data is:
This is sample data

Column only has room for:
This is sample da

When I click in the cell, it changes to:
This is sample

When I leave the cell, it changes back to:
This is sample da

Is this a property of the DataGridTableStyle? Can I fix it
so that when I click in the cell, all the data is there if
I right arrow over? Thanks.

Sean


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com

Nov 20 '05 #10

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

Similar topics

1
by: Kim | last post by:
Hello, I am selecting data from a text file with the following statement: "INSERT INTO SELECT * FROM " & sSource & " IN '' " & _ "'text;Database=" & sPath & ";FMT=Delimited;HDR=No' " & _...
1
by: L Mehl | last post by:
Hello -- Goal is to export data from tblData having this structure: dateRecord Date/Time textFrom Text 4 textTo Text 4 valueRecord Number Double (format = Standard, Dec Pl = 12)...
3
by: Bill C. | last post by:
Hello, I know this has been discussed a lot already because I've been searching around for information the last few weeks. I'm trying to implement a DataGridComboBoxColumn class. I've found...
19
by: Jerry | last post by:
I managed to narrow this down to a very simple expression. try this: private void Bug() { bool b = false; Test(3, (b || b) && b && !b); } private void Works() {
4
by: Glenn Owens | last post by:
I have a DataGrid web control which I've dynamically populated with template columns to be used for bulk-editting. Generally, all of the columns are textbox and/or dropdownlist child controls. ...
0
by: aPRSComp | last post by:
Hi, Has anyone seen where using SELECT * truncates characters ? mysql> SELECT * FROM countries; +-------------+-----------+ | country | capital | +-------------+-----------+...
5
Shakss2
by: Shakss2 | last post by:
Hi... I am exporting some data from a table with a memo field to excel but the excel report truncates the memo field data to 255 chars. Dim strPath As String ' Current path strPath =...
2
by: Aads | last post by:
Hi all, Below is my query which truncates the value of the float variable. I have no clue why it truncates. Can anyone help me out? Declare @myValue Float set @myValue =...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.