locked
Displaying all the text in the grid? RRS feed

  • Question

  • User233555810 posted

    Hi Guys

    I’m pretty new at dynamic data sites (been playing with it for about 1 week... great stuff).

    One thing that does my head-in is that it does not matter what I do, I cannot get my full text strings to display in the Grid in “ListDetails.aspx”. It seems to always display about 22 char and then rounds it off with “…”. A bit of a pain as my strings are only about 25 chars long.

    Any idea how to get around this, or to switch of the “…” ?

    Many thanks

    Monday, November 28, 2011 11:36 AM

Answers

All replies

  • User617492218 posted

    what i'm thinking is that in your DB, when you have a column, and that column's text is many chars, it always has the "..." at the end, meaning that there's more. now that doesn't explain why your gridview would be doing that, nor does it make sense to me. post your aspx code and code behind - maybe you have some syntax error

    Monday, November 28, 2011 11:46 AM
  • User233555810 posted

    Hi Rob. Thanks for the quick reply. What im doing is really straight forward.

     1)      I created a DB with a table named Table_1. The schema as follows:

     CREATE TABLE [dbo].[Table_1](
          [testCol] [nvarchar](50) NULL
    ) ON [PRIMARY]

     2)      I populate the table with 5 rows:

     testCol
    --------------------------------------------------
    1234567890123456789012345678901234567890
    1234567890123456789012345678901234567890
    1234567890
    12345678901234567890
    123456789012345678901234567890
    1234567890123456789012345678901234567890

    3)      I create a default site with no changes to the aspx.

    4)      I create a LinQ to SQL class and drag my table above into it and enable in global.asax.

    5)      I hit “view in browser”

    When I navigate to the table, I get:

    Table_1s 

    testCol

    1234567890

    12345678901234567890

    1234567890123456789012...

    1234567890123456789012...

    1234567890123456789012...

    1234567890123456789012...

    1234567890123456789012...

    I would really like to see the entire row. As you can see, there is plenty of space in the table, yet my string is concatenated after char(22).

    What I’d like to do is force the aspx to display the entire row as seen in step 2 above.

    Any ideas?
    Many thanks

    Tuesday, November 29, 2011 4:46 AM
  • User233555810 posted

    OH, PS:<o:p></o:p>

    It also happens when there are spaces in the testCol values. (in case someone thinks it is because it is caused by the single non-spaces strings) 

    <o:p></o:p> 

    Tuesday, November 29, 2011 4:48 AM
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 29, 2011 5:12 AM
  • User233555810 posted

    thanks valZ

    Quick answer: in FieldTemplates folder, goto Text.ascx and open Text.ascx.CS/VB.

     Edit constant : MAX_DISPLAYLENGTH_IN_LIST = (what ever you want the cut-off to be).

    For Custom attribute, see link above.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 29, 2011 6:00 AM
  • User350138131 posted

    More correct to use the [FieldOptions(Columns=what ever you want the cut-off to be)] attribute

    Wednesday, November 30, 2011 5:55 AM