dear Support,
we need to display new lines (paragraphs)( like it is in multiline textox ) in one of our datagrid colum (Phrase)
we arleady enable AllowTextWrap="true" in our grid which works, but the problem is, it does not show the new lines in the text.when we edit the text in a multiline textbox it displays fine.
here is our grid code. can you please provide a working code/ OR sample for the above requiremnt?
thank you
@{
List<Syncfusion.Blazor.Navigations.ItemModel> Toolbaritems3 = new List<Syncfusion.Blazor.Navigations.ItemModel>();
Toolbaritems3.Add(new Syncfusion.Blazor.Navigations.ItemModel() { Text = "add Phrase", Id = "add", TooltipText = "add", PrefixIcon = "e-add_new" });
}
<SfGrid RowHeight="25" @ref="GridnametemplatereportDetails" AllowTextWrap="true" Toolbar="Toolbaritems3" DataSource="@TemplateReportDetailObjects" AllowPaging="false" EnableVirtualization="true" AllowSorting="false" AllowFiltering="false" Height="900px">
<GridEvents OnToolbarClick="ToolbarClickHandler3" TValue="Model.TemplateReportDetail" RowDataBound="RowBoundColorIt"></GridEvents>
<GridTextWrapSettings WrapMode="WrapMode.Content"></GridTextWrapSettings>
<GridSortSettings>
<GridSortColumns>
<GridSortColumn Field="PhraseSortOrder" Direction="SortDirection.Ascending"></GridSortColumn>
</GridSortColumns>
</GridSortSettings>
<GridPageSettings PageSize="50"></GridPageSettings>
<GridFilterSettings Mode="FilterBarMode.Immediate" ImmediateModeDelay="50"></GridFilterSettings>
<GridColumns>
<GridColumn HeaderText="" TextAlign="TextAlign.Left" AutoFit="true">
<Template>
@{
var data = (context as MyApp.Model.TemplateReportDetail);
<a @onclick="(args => (editRow3(data)))"><i class="e-icons e-edit" style="margin-left:3px;"></i></a>
<a @onclick="(args => (deleteRow3(data)))"><i class="e-icons e-delete" style="margin-left:3px;"></i></a>
}
</Template>
</GridColumn>
<GridColumn Field=@nameof(MyApp.Model.TemplateReportDetail.Phrase) HeaderText="Phrase" TextAlign="TextAlign.Left" FilterSettings="@(new FilterSettings { Operator = Operator.Contains })"> </GridColumn>
<GridColumn Visible="false" Field=@nameof(MyApp.Model.TemplateReportDetail.PhraseSortOrder) HeaderText="PhraseSort Oder" TextAlign="TextAlign.Left" AllowEditing="false" AllowFiltering="false"></GridColumn>
<GridColumn Visible="false" Field=@nameof(MyApp.Model.TemplateReportDetail.Id) HeaderText="dbid" TextAlign="TextAlign.Left" IsIdentity="true" IsPrimaryKey="true" AutoFit="true" FilterSettings="@(new FilterSettings { Operator = Operator.Equal })"></GridColumn>
</GridColumns>
</SfGrid>
<Template>
@{
string modifiedstring = Regex.Replace((context as Order).CustomerID, @"(\r\n)|\n|\r", "<br/>");
MarkupString FormattedString = (MarkupString)modifiedstring;
<div>@FormattedString</div>
}
</Template>
</GridColumn>
|