By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,257 Members | 928 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,257 IT Pros & Developers. It's quick & easy.

Datagrid Truncates Data?

P: n/a
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
Share this Question
Share on Google+
9 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.