Grids - wrap text?

General development discussion.

Moderators: Susan Smith, admin, Gabriel

Post Reply
Susan Smith
Posts: 717
Joined: Sun Aug 10, 2008 4:24 am
Location: Southern California

Grids - wrap text?

Post by Susan Smith »

Hey you grid gurus...

Is there a way to wrap text in a grid? I'm guessing not, but I'm hoping there is. This would be for a display-only column.

-- Susan
Gabriel
Posts: 412
Joined: Sun Aug 10, 2008 7:37 am
Location: Arlington, TX
Contact:

Post by Gabriel »

I wish...
Susan Smith
Posts: 717
Joined: Sun Aug 10, 2008 4:24 am
Location: Southern California

Post by Susan Smith »

Yeah, that's what I thought...

I'll think of another way to approach it. It's worth asking anyway. Half the time (or more), I ask an off-the-wall question and George replies that this is also in FNSNAP! It's like the magician's bottomless carpet bag that he keeps pulling huge things out of that couldn't possibly fit in there. LOL!

-- Susan
Gabriel
Posts: 412
Joined: Sun Aug 10, 2008 7:37 am
Location: Arlington, TX
Contact:

Post by Gabriel »

Maybe George still will do that. Actually, I was kind of hoping he would, or somebody would have an answer.

By the way, wouldn't that make the entire grid multiline?

The closest thing I can suggest is that you have a protected multiline text box that you update whenever the current row in the grid changes. This allows them to see the data for a large field all on the screen at once. Its not quite as pretty, and its limited to showing the data for one row at a time only, but depending on the purpose of the routine, it may get you where you need to be.

Gabriel
Susan Smith
Posts: 717
Joined: Sun Aug 10, 2008 4:24 am
Location: Southern California

Post by Susan Smith »

I'm not exactly sure what you're talking about regarding the text box and the grid in combination, but it gives me an idea so thanks! I rarely use multiline text boxes (like never, really) and this might be just the time to use one.

-- Susan
Susan Smith
Posts: 717
Joined: Sun Aug 10, 2008 4:24 am
Location: Southern California

Post by Susan Smith »

Wait a sec, I might get this now...

Gabriel, is this what you mean? You use a grid or listview to display PART of the long field (that I wanted to wrap), and when they click on that line, you pop up a multiline text box to do the editing?

Hmmm. Even if that's not what you meant, I think it might work!

-- Susan
gtisdale
Posts: 218
Joined: Sun Jun 07, 2009 7:54 am
Location: Concord, Massachusetts
Contact:

Post by gtisdale »

Gee, I looked, but do not happen to have a function in FNSNAP to do text wrapping in a grid.

There are a couple of ways to handle what you are asking.

In a grid you can use the field syntax "20/V 1000" to allow a large amount of text to be displayed in a small area of the grid. The problem of course is that you need to "Enter" the cell and then scroll back and forth to read all of the text. Becasue you eneterd the cell you need to determine whether the user can modify/delete what is in the cell and that impacts what you do when you exit the grid. Do you save changes to that array, or do you force it back to what it was before the user changed it.

Using a multiline text box is definitely another solution. You would open the textbox in a separate window (you need to do this becasue the way a multiline text box works is to fill a window and do wrapping within the constraints of the window. THis could also be accomplished by reserving the bottom (or top) X lines of the window the grid is opened in for the text box. The form statements for all of the cells in the grid would then carry the "X" attribute so that as the grid is navigated changing cells forces an exit from th grid and allows you to determine where you are. You would need to determine the NXTFLD paramenter so that you know the cell you are moving into. That NXTFLD position can then be translated to a row number and the text of the array that matches that row could be displayed in your wrapping textbox. Again you would need to determine whether the user could change the data.

Another possibility is to thow the whole thing into an RTF file and display it with Word or Open Office using table formats that allow wrapping within cells of an RTF document
Susan Smith
Posts: 717
Joined: Sun Aug 10, 2008 4:24 am
Location: Southern California

Post by Susan Smith »

hi George,

I think you hit on the idea I was learning toward (using RTF). That's how the original msg was entered. This routine (thanks and credit to David for invaluable and APPRECIATED help) lets the user add unlimited notes or comments to be associated with a member (customer). The notes are entered via RTF in an external RTF editor, and then broken up into fixed-length segments and written to a BR file with a header written to each "piece" of the note to tie them together. The header contains the date/time stamp, user, and member #. This allows me to index the notes by member so that when a member is called up on the screen and the "view notes" button is clicked, all of the notes for that member are assembled and displayed (in reverse date order) in an RTF viewer in one "document" . I hadn't intended to let the user edit these notes, but my customer is insisting so I'm scrambling to accommodate them.

My current plan is to re-assemble the BR note segments from the current member on the screen, but display them individually in rows of a grid instead combined in one RTF file. My challenge is in the display of the notes since they are all of unknown (and potentially unlimited) length. And then I need a method by which the user can indicate that they want to delete or edit one of those notes. A grid seems the most likely choice, except for the small issue of not being able to wrap text. But scrolling should be adequate and reading in a limited part of the message (for the grid) should be enough to identify it. I'll add columns for the date/time stamp and user #).

In a perfect world, I would like to display the messages - wrapped - in a grid with a checkbox in the next two columns (one for "edit" and one for "delete"). But short of that, I'm trying to be creative here and find something that will work in 4.18. Maybe there's a BR 4.2 PEM solution in my future :)

Thanks for the suggestion. That's probably the way I'll go with it. Sorry for the long message.

-- Susan
Gabriel
Posts: 412
Joined: Sun Aug 10, 2008 7:37 am
Location: Arlington, TX
Contact:

Post by Gabriel »

Thats just about what I was thinking. Only I wasn't going to make them click on a button to display the multiline text field.

I was thinking you'd have your grid somewhere, and then perhaps below it, or perhaps to the right, you'd have a multi-line textbox. Every time the user changes the current row in the listview, you'd update the textbox so that it always shows the note for the currently selected row in the grid/listview.

If you can fit it all in a single line grid (with scrolling) then more power to you. But if its just too much data for the user to be scrolling back and forth with all the time, then this might be an alternate way of displaying it thats slightly more useful and intuitive then a grid by itself.

Gabriel
Susan Smith wrote:Wait a sec, I might get this now...

Gabriel, is this what you mean? You use a grid or listview to display PART of the long field (that I wanted to wrap), and when they click on that line, you pop up a multiline text box to do the editing?

Hmmm. Even if that's not what you meant, I think it might work!

-- Susan
Post Reply