This is a migrated thread and some comments may be shown as answers.

Telerik Grid Not displaying text enter in new line

1 Answer 186 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Shashikant
Top achievements
Rank 1
Shashikant asked on 06 Aug 2013, 06:47 AM
Hi,

I am using telerik Grid View and telerik RadAjaxPanel to display records in grid. But the description column is not displaying the records in new line where as when I click edit button the text is in new line. However I changed the text and pressed Enter Button from keyboard and then again typed some text. After clicking Update button. The text I entered is still appearing in single line.

It tried creating Functions and then called it on label. But i did n't worked.

Here is the code:
 
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1"   CssClass="TabGrid">
<td style="width: 270px;" class="details" colspan="3">
                                                <asp:TextBox ID="txt_description" runat="server" TextMode="MultiLine" Height="50" Width="500" AcceptsReturn="False" CssClass="inputtype" ></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="req_first_name" runat="server" ControlToValidate="txt_description"
                                                    ValidationGroup="_basic" Display="Dynamic" ErrorMessage="<br>Description Required"></asp:RequiredFieldValidator>
                                                <asp:Label ID="lbl_description" runat="server" Text='<%# FixCrLf(Eval("postEventFeedback")) %>' ></asp:Label>
                                                </td>
                    </telerik:RadAjaxPanel>



The Function I have used :

  
Protected Function FixCrLf(value As String) As String
        If String.IsNullOrEmpty(value) Then Return String.Empty
        Return value.Replace(Environment.Newline, "<br />")
    End Function

1 Answer, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 09 Aug 2013, 08:22 AM
Hi Shashikant,

Could you please elaborate more on the type of column to which the field required to allow new line symbols is related? Generally in such scenarios you should use the GridHTMLEditorColumn because by default the new line symbol will be escaped.

Regards,
Angel Petrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
Shashikant
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
Share this question
or