Display long text strings in GridView Columns in ASP.Net

Last Reply on Apr 09, 2014 04:01 AM By Azim

Posted on Apr 07, 2014 11:01 PM

In my website, there is a page called "SMS Log"

It contains a GridView, in which there are 5 columns:

1) SMS sent time
2) SMS Text
3) Recipients
4) status
5) Buton (view detail)

since, "SMS Text" is large and "Recipients" are more than 1. So Gridview looks very conjusted, also it does not look good.

Is there any other control I can use other than Gridview to show above 5 columns in a well organised way. so thats it should look good?

Please reply

Posted on Apr 09, 2014 03:43 AM

If your data goes in that column with "\n" (NewLine, usually when you put data for this column from textarea/multiline textbox) then you can use

<asp:TemplateField HeaderText="Amount Desc" ItemStyle-VerticalAlign="Top">
    <itemtemplate>

    <%# Eval("YourDescriptionColumn").ToString().Replace(Environment.NewLine, "<br/>")%>

    </itemtemplate>
</asp:TemplateField>

 


Posted on Apr 09, 2014 04:01 AM Modified on on Apr 10, 2014 11:51 PM

You can do one thing, Set the width of SMS Text columns to 150 or 200. Display some text with.... and if User mouse over the cell, full description will be shown in the popup. You can use hover menu extender for this.

Refer these.

  1. Display AJAX HoverMenuExtender for a GridView Cell in ASP.Net
  2. Using ASP.Net AJAX HoverMenuExtender inside GridView Control

 

Thank You.