locked
Lightswitch row autosize / wordwrap? RRS feed

  • Question

  • Can I set the rows in a lightswitch grid to automatically adjust their height and wrap text based on the amount of text? So far, all I can get it to do is truncate the text based on the width of the column. I want the row height to adjust and the text to wrap so that all the text is visiable. I've tried setting the height to "auto" in both the grid and the column controls with no luck.

    Tuesday, November 22, 2011 3:23 PM

Answers

  • Hi

    you can find out that my Control Type is Label, not Text Box. Change to Label and it should work for you.

    I used Search Screen to demonstrate wordwrap.

    Best regards


    Spaso Lazarevic
    • Marked as answer by Jesse Chunn Tuesday, November 22, 2011 10:51 PM
    Tuesday, November 22, 2011 10:29 PM

All replies

  • Hi

    Please, see thread if it can help you: Datagrid column sizing - size to content Already solved 

    Hope this help


    Spaso Lazarevic
    Tuesday, November 22, 2011 8:25 PM
  • Thanks Spaso. I tried that, but unfortunately it did not solve my problem. The "auto" option does not seem to do anything at all, even if the "pixel" value is cleared.

    Is it "supposed" to work? I mean, does anyone ever see their rows autosize based on content? I assumed that because there was an "auto" option, that it would just work, but it does not.


    Jesse Chunn
    Tuesday, November 22, 2011 8:39 PM
  • Hi

    It seem that grid has a problem if you try it with Summary column only (column with a link).

    You can get wordwrap like in this screen:

    Setting Height in Vertical Alignment to Auto-size whatever Width is (Auto-size or Fixed in Pixels)

    Hope this help


    Spaso Lazarevic
    Tuesday, November 22, 2011 8:57 PM
  • I appreciate your response!

    How did you get that functionality? I cannot make my application do that. The only way I can get the rows to be more than one-line high is to set it to "Lines" and set the lines to some number other than 1, like 3 or 4, in which case EVERY ROW is 3 or 4 lines high. I want it to work just like your example above... what are you doing to make that work??


    Jesse Chunn
    Tuesday, November 22, 2011 9:15 PM
  • Hi Jesse

    This is settings for multi row:

    Best regards


    Spaso Lazarevic
    Tuesday, November 22, 2011 9:35 PM
  • Thanks again for your reply.

    I am very frustrated. Here are my settings:

    They look very similar to yours. I notice that you have "Auto-size" and I only have "Auto". I am using VS 2010 Ultimate. Is it possible that I have an old version of Lightswitch? I am running Lightswitch 2011.


    Jesse Chunn
    • Edited by Jesse Chunn Tuesday, November 22, 2011 10:19 PM
    Tuesday, November 22, 2011 10:18 PM
  • Hi

    you can find out that my Control Type is Label, not Text Box. Change to Label and it should work for you.

    I used Search Screen to demonstrate wordwrap.

    Best regards


    Spaso Lazarevic
    • Marked as answer by Jesse Chunn Tuesday, November 22, 2011 10:51 PM
    Tuesday, November 22, 2011 10:29 PM
  • Hi again

    But if you want Text Box control to make multilined in Grid, you need to use Lines (2,3...) options under Vertical Alignment properties to set the number of lines you want.

    Hope this help


    Spaso Lazarevic
    Tuesday, November 22, 2011 10:50 PM
  • Hi Spaso,

    Changing the item to "Label" worked. I did see your next post about the textbox.

    I am now having another issue, which I'll post in another thread if I can't find a solution to after some searching. About half of the grid doesn't render below the first row.

    Anyway, thanks!


    Jesse Chunn
    Tuesday, November 22, 2011 10:56 PM