Shorten / Camouflage too large text within a grid

0

I have this line of the grid that takes the description of a message, however it is very large and sometimes it breaks the layout of the grid, I would like to know if it is possible to shorten the message and / or camouflage the message in a link. p>

That is, take the message and replace it with a Visulize

Follow the code below:

<asp:TemplateField HeaderText="ÚLTIMA MENSAGEM">
      <ItemStyle HorizontalAlign="Center" />
<ItemTemplate>
     <a href="cicloObjetivo.aspx?Cod=<%# Eval("OcIDescr")%>" style="color: #0000FF;">
          <%# Eval("OcIDescr").ToString()%>'</a>
 </ItemTemplate>
   </asp:TemplateField>

Grid:

    
asked by anonymous 10.05.2018 / 23:26

1 answer

1

A suggestion for you:

  • In the class you have the description property (OcIDescr) you can add a new property that would be the short description, when the user clicks on it you would open a modal showing the full text. p>

    public string OcIDescrResumida
    {
        get
        {
            return !string.isNullOrWhiteSpace(OcIDescr) ? OcIDescr.Substring(0, 20) + "..." : string.empty
        }
    }
    

Do not forget to replace your code snippet with this new property.

    
28.06.2018 / 22:10