Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Showing multiple lines in a grid column 1

Status
Not open for further replies.

Rajesh Karunakaran

Programmer
Sep 29, 2016
549
MU
Hi all,

I have a grid and a cursor having the data to show in it. There is one column which I need to show in multiple lines.
I was wondering is there a straight method to show multiple lines in a grid column. I don't mind what control should be there in the column. At least for now, the purpose is only to view.

Even though doubtful, I just tried inserting a CHR(13)+CHR(10) to break the lines in that particular column data in the cursor.

So, the cursor column has value as "Rajesh" + CHR(13)+CHR(10) + "Registration Renewal" + CHR(13)+CHR(10) + "08:00 AM"

But it doesn't work or rather it won't I think as the grid column control is a TextBox. Then, I expected that an edit box should do this. So, I removed the TextBox and put a EditBox as the control. But, that also doesn't seem to work.

If anyone's thoughts catching up any quick ideas, can you please share?!

Thanks in advance,
Rajesh
 
Hi

You need to make the current control property point to an EditBox - in the IDE, I would edit the grid, click on the column of interest and delete
the existing TextBox, then add the Editbox as a new control - which will make it the current control. Double check the data for the edit box
is set to whatever field you want and away you go.

I'm not 100% sure this is still relevant, but I have a policy of limiting the text displayed in an edit box in a grid to around 100 characters,
at the back of my mind I think you can get unexpected behaviour if you use a memo field with a novel in there as the 'neat' control source..



Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Hi Griff,

Yes, I had already put an EditBox instead of the default TextBox. But now, the data is shown in a single line as if it ignores my CHR(13)+CHR(10) and when I click in that column, then the line breaks come up and content shown as I expect.

First it shows as:
RajeshRegistration Renewal08:00AM

When I click the cell:
Rajesh
Registration Renewal
08:00AM

Any idea why it shows this behaviour?

Rajesh
 
What is the sparse property set to?

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Oh Dear Griff,

That 'Sparse' did the trick!!! Thank you very much.
In fact, I know about Sparse which I set when I use things like a CheckBox in grid.
But, I am wondering why it didn't come to mind!

Anyway, thank you dear!

Rajesh

 
Happy to help

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Sir, if You are in india, can you pls give your number so that I can get your help in some issues on call
 
Sng1, if you are referring to me; no, I am in the UK.

Be aware that contact details are not allowed in posts on TT

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Sng1, Tek Tips is a community forum, where we all help each other. It is not intended as a way of looking for work or for offering work. There are other on-line resources where you can do that.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top