or
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"> </telerik:RadScriptManager> <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> <script type="text/javascript"> function RowDblClick(sender, eventArgs) { sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical()); } </script> </telerik:RadCodeBlock> <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" GridLines="None" Skin="Vista" onneeddatasource="RadGrid1_NeedDataSource" ondeletecommand="RadGrid1_DeleteCommand" oninsertcommand="RadGrid1_InsertCommand" onupdatecommand="RadGrid1_UpdateCommand" onitemdatabound="RadGrid1_ItemDataBound" > <ClientSettings EnableRowHoverStyle="true" AllowKeyboardNavigation="false"> <Selecting AllowRowSelect="True" /> <Scrolling AllowScroll="True" UseStaticHeaders="True" /> <ClientEvents OnRowDblClick="RowDblClick" /> <KeyboardNavigationSettings EnableKeyboardShortcuts="true" AllowActiveRowCycle="true" /> </ClientSettings> <MasterTableView EditMode="PopUp" CommandItemDisplay="Bottom"> <Columns> <telerik:GridBoundColumn UniqueName="Id" visible="false" ReadOnly="true" DataField="Id" HeaderText="Id" > </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="Nombre" AutoPostBackOnFilter="True" CurrentFilterFunction="Contains" DataField="Nombre" HeaderText="Nombre" ShowFilterIcon="False"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="Precio" AutoPostBackOnFilter="True" CurrentFilterFunction="Contains" DataField="Precio" HeaderText="Precio" ShowFilterIcon="False"> </telerik:GridBoundColumn> <telerik:GridButtonColumn ConfirmText="Borrar este método?" ConfirmTitle="Borrar" ButtonType="ImageButton" CommandName="Delete" Text="Borrar" UniqueName="DeleteColumn" ConfirmDialogType="RadWindow"> <HeaderStyle Width="30px" /> <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" /> </telerik:GridButtonColumn> <telerik:GridEditCommandColumn ButtonType="ImageButton"> <HeaderStyle Width="30px" /> <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" /> </telerik:GridEditCommandColumn> </Columns> <CommandItemSettings AddNewRecordText="Añadir nuevo registro" RefreshText="Refrescar" /> <EditFormSettings EditColumn-CancelText="Cancelar" EditColumn-Display="True" EditFormType="AutoGenerated"> <FormTableItemStyle Wrap="False"></FormTableItemStyle> <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle> <FormMainTableStyle GridLines="None" CellSpacing="5" CellPadding="3" BackColor="White" Width="100%" /> <FormTableStyle CellSpacing="0" CellPadding="2" Height="60px" BackColor="White" /> <EditColumn ButtonType="ImageButton" InsertText="Guardar" UpdateText="Guardar cambios" UniqueName="EditCommandColumn1" CancelText="Cancelar edición" > </EditColumn> <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle> <PopUpSettings Modal="True"></PopUpSettings> </EditFormSettings> </MasterTableView> </telerik:RadGrid><FieldEditors> <telerik:RadFilterTextFieldEditor DataType="System.String" DisplayName="Text" FieldName="ShipName" /></FieldEditors>Hi,
I'm exporting a RadGridview to excel, the only thing that I need is add a new line inside some cells,
the value inside the cell has \t \n but when I export the excel I get something like this <br> inside my excel file.
I'm using the following to change from \t \n to <br> but It doesn't work
if (e.Element == ExportElement.Cell )
{
e.Value = e.Value.ToString().Replace("\t \n", " <br> ");
}
what is the corret way to do it.
Thanks in advance