or
<telerik:RadGrid runat="server" ID="grdExtraFields" AutoGenerateColumns="false" AllowPaging="true" Width="90%" Height="400px" AllowSorting="true" DataSourceID="sqlVCK" PageSize="20" AllowAutomaticInserts="true" AllowAutomaticUpdates="true" AllowAutomaticDeletes="true"> <MasterTableView EditMode="InPlace" AutoGenerateColumns="false"> <Columns> <telerik:GridEditCommandColumn UniqueName="btnEdit" ButtonType="LinkButton" /> <telerik:GridTemplateColumn DataField="section" HeaderText="Section Name" UniqueName="section"> <ItemTemplate> <telerik:RadComboBox ID="cboSection" runat="server" DataSourceID="sqlSection" DataTextField="description" DataValueField="section" Width="200px" Enabled="false"> </telerik:RadComboBox> </ItemTemplate> <EditItemTemplate> <telerik:RadComboBox ID="cboSection" runat="server" DataSourceID="sqlSection" DataTextField="description" DataValueField="section" Width="200px"> </telerik:RadComboBox> </EditItemTemplate> </telerik:GridTemplateColumn> <telerik:GridBoundColumn DataField="INTERNAL_READABLE" HeaderText="Internal Name" UniqueName="internalname" /> <telerik:GridBoundColumn DataField="EXTERNAL_READABLE1" HeaderText="External Name" UniqueName="externalname" /> <telerik:GridTemplateColumn DataField="GRIDS_DATATYPE" HeaderText="Type" UniqueName="type"> <ItemTemplate> <telerik:RadComboBox ID="cboType" runat="server" selectedvalue='<%#Bind("GRIDS_DATATYPE") %>' Enabled="false"> <Items> <telerik:RadComboBoxItem Text="Label (-4)" Value="-4" /> <telerik:RadComboBoxItem Text="Label (-3)" Value="-3" /> <telerik:RadComboBoxItem Text="Key field" Value="-2" /> <telerik:RadComboBoxItem Text="System control" Value="-1" /> <telerik:RadComboBoxItem Text="Textbox" Value="1" /> <telerik:RadComboBoxItem Text="Tree" Value="4" /> <telerik:RadComboBoxItem Text="Listbox" Value="7" /> <telerik:RadComboBoxItem Text="Multi-line text" Value="9" /> <telerik:RadComboBoxItem Text="Date" Value="170" /> </Items> </telerik:RadComboBox> </ItemTemplate> <EditItemTemplate> <telerik:RadComboBox ID="cboType" runat="server" selectedvalue='<%#Bind("GRIDS_DATATYPE") %>'> <Items> <telerik:RadComboBoxItem Text="Label (-4)" Value="-4" /> <telerik:RadComboBoxItem Text="Label (-3)" Value="-3" /> <telerik:RadComboBoxItem Text="Key field" Value="-2" /> <telerik:RadComboBoxItem Text="System control" Value="-1" /> <telerik:RadComboBoxItem Text="Textbox" Value="1" /> <telerik:RadComboBoxItem Text="????" Value="4" /> <telerik:RadComboBoxItem Text="Listbox" Value="7" /> <telerik:RadComboBoxItem Text="Multi-line text" Value="9" /> <telerik:RadComboBoxItem Text="Date" Value="170" /> </Items> </telerik:RadComboBox> </EditItemTemplate> </telerik:GridTemplateColumn>... </Columns> </MasterTableView> <ClientSettings> <Scrolling AllowScroll="true" UseStaticHeaders="true" /> </ClientSettings></telerik:RadGrid><asp:SqlDataSource id="sqlVCK" runat="server" ConnectionString="<%$ ConnectionStrings:iknetConnectionString %>" SelectCommand="select internal_readable, external_readable1, ... from grids where custfile = @custfile AND department = @dept AND section in (10, 13, 15, 16)" InsertCommand="INSERT INTO grids (SECTION, INTERNAL_READABLE, EXTERNAL_READABLE1, EXTERNAL_READABLE2, EXTERNAL_READABLE3, ..., GRIDWIDTH, REQUIRED) VALUES (@section, @fieldname, @fieldname, @fieldname, @fieldname, ..., -1, @required)" UpdateCommand="UPDATE grids SET internal_readable = @internal_readable, external_readable1 = @EXTERNAL_READABLE1, external_readable2 = @EXTERNAL_READABLE1, external_readable3 = @EXTERNAL_READABLE1, ..., section = @section where grids = @grids" DeleteCommand="DELETE FROM grids WHERE grids = @grids"> <SelectParameters> <asp:Parameter Name="custfile" type="Int32" /> <asp:Parameter Name="dept" Type="Int32" /> </SelectParameters> <UpdateParameters> <asp:Parameter Name="internal_readable" type="string" /> <asp:Parameter Name="EXTERNAL_READABLE1" type="string" /> <asp:Parameter Name="grids_datatype" type="Int32" />... <asp:Parameter Name="grids" type="Int32" /> </UpdateParameters> <InsertParameters> <asp:Parameter Name="section" type="Boolean" /> <asp:Parameter Name="fieldname" type="string" /> <asp:Parameter Name="type" type="Int32" />... <asp:Parameter Name="required" type="Boolean" /> </InsertParameters> <DeleteParameters> <asp:Parameter Name="grids" type="Int32" /> </DeleteParameters></asp:SqlDataSource><telerik:RadScriptManager runat="server" ID="RadScriptManager1" /> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" > <AjaxSettings> <telerik:AjaxSetting AjaxControlID="btnAddItem"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="tvProjectSummary" LoadingPanelID="RadAjaxLoadingPanel1"> </telerik:AjaxUpdatedControl> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Width="270px" BackgroundPosition="Center" Skin="Outlook" EnableSkinTransparency="true"> </telerik:RadAjaxLoadingPanel> <telerik:RadTreeView ID="tvProjectSummary" runat="server" AllowNodeEditing="true" EnableDragAndDrop="true" Skin="Metro" OnClientNodeDropping ="SaveCtrlState" OnNodeDrop="HandleDrop"> <Nodes> <telerik:RadTreeNode Value="Root" ImageUrl="Images/subfolder_button.png" AllowEdit="true" Text="NEW PROJECT" Font-Bold="true" Selected="true"> </telerik:RadTreeNode> </Nodes> </telerik:RadTreeView> <asp:Repeater ID="rptItems" runat="server" OnItemCommand="rptItems_ItemCommand"> <ItemTemplate> <ul class="options_items"> <li> <asp:Label ID="lblItems" runat="server" Text="<%# Container.DataItem %>"></asp:Label> <asp:LinkButton ID="btnAddItem" runat="server" CommandName="AddItem" >Add+</asp:LinkButton> </li> </ul> </ItemTemplate> </asp:Repeater>We are able to declare a custom styles list correctly. The issue that we have is when we apply a custom style to a selection the RadEditor defaults to wrapping the selection in "Font" tags. We want it to wrap in "Div" tags, instead.
Given the following HTML code, before applying styles:
<p>my text document looks kind of like this. And sometimes I highlight a whole tag like this:</p> <p>MY HEADER</p> <p>or maybe I highlight text INSIDE OF THIS P TAG and turn it into a subparagraph.</p><p>my text document looks kind of like this. And sometimes I highlight a whole tag like this:</p> <p class="section header">MY HEADER</p> <p>or maybe I highlight text <FONT class="section subparagraph">INSIDE OF THIS P TAG</FONT> and turn it into a subparagraph.</p> <p>my text document looks kind of like this. And sometimes I highlight a whole tag like this:</p> <div class="section header">MY HEADER</div> <p>or maybe I highlight text <div class="section subparagraph">INSIDE OF THIS P TAG</div> and turn it into a subparagraph.</p> <!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title></head><body> <form id="form1" runat="server"> <telerik:RadScriptManager runat="server" ID="RadScriptManager1" /> <div> <telerik:RadContextMenu runat="server" ID="ctx"> <Targets> <telerik:ContextMenuElementTarget ElementID="test" /> </Targets> <Items> <telerik:RadMenuItem Text="Item 1" /> <telerik:RadMenuItem Text="Item 2" /> <telerik:RadMenuItem IsSeparator="true" /> <telerik:RadMenuItem Text="Item 3" /> <telerik:RadMenuItem Text="Item 4"> <Items> <telerik:RadMenuItem Text="Item 5" /> <telerik:RadMenuItem Text="Item 6" /> </Items> </telerik:RadMenuItem> </Items> </telerik:RadContextMenu> <div id="test" style="width: 300px; height: 300px; background-color: red"> Right click here! </div> </div> </form></body></html>