Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
138 views

I am injecting some HTML into the RadEditor's content window using the pasteHtml method in JavaScript.  The HTML I am pasting includes a <span> element, like this:

editor.pasteHtml("<span class='text-highlight'>@MyText</span>");

 

In all browsers, in Design view, after the text is pasted, the cursor appears after the span contents ("@MyText" in the example above).  In Chrome, the cursor is actually positioned inside the <span> tag (which is what I want).  In IE and Edge, however, the cursor position appears after the closing <span> tag.

Is there any way to get the cursor inside the <span> tag after the paste occurs?  I tried using variations of the range.collapse() methods (which have major limitations in IE anyway), but it had the adverse effect of taking the focus away from the RadEditor control.

 

Rumen
Telerik team
 answered on 14 Dec 2018
1 answer
97 views

 

When the editor is opened in Microsoft Edge, <br /> is present in the html, with or without taking focus in the content area.

Does appear to do this in Chrome.

 

Rumen
Telerik team
 answered on 14 Dec 2018
17 answers
805 views
Hello Everyone,

i want to close Menu-items after clicked on any MenuItems using javscript  OnClientItemClicked.

and my RadMenuItems are under

<telerik:GridTemplateColumn >
                        <ItemTemplate>
                     <telerik:RadMenu ID="RadMenuClient" runat="server" EnableRoundedCorners="true" EnableShadows="true"
                            OnClientItemClicked="OnClientItemClicked" ExpandAnimation-Type="None" CollapseAnimation-Type="None"
                            ExpandDelay="0" CollapseDelay="0" Selected="false" ClickToOpen="true">
                            <Items>
                              <telerik:RadMenuItem ImageUrl="../images/1.jpg" Selected="false">
                                <GroupSettings ExpandDirection="Down" OffsetX="20" OffsetY="-20" />
                                <Items>
                                  <telerik:RadMenuItem Text="Add" Value="Add">
                                  </telerik:RadMenuItem>
                                  <telerik:RadMenuItem Text="Edit" Value="EditI">
                                  </telerik:RadMenuItem>
                                  <telerik:RadMenuItem Text="Delete" Value="Delete">
                                  </telerik:RadMenuItem>
                               </Items>
                              </telerik:RadMenuItem>
                            </Items>
                          </telerik:RadMenu>
                        </ItemTemplate>
                      </telerik:GridTemplateColumn>


can anyone help me ?

Thanks,
Peter Milchev
Telerik team
 answered on 14 Dec 2018
10 answers
1.1K+ views
Hi all,

I have a RadWindow which is popped up and centered. When the user decides to resize the browser window (e.g. changing it from maximized to partial-screen) the RadWindow does not re-center. I thought the easiest way to do this would be a bit of jQuery, but it doesn't seem to be firing?

$(window).resize(function () {
    var oWindow = GetRadWindow();
    if (oWindow.isVisible()) {
        oWindow.center();
    }
});

Is there anything wrong with this? I just have it floating inside of a RadCodeBlock/javascript block.

Thanks

Sean
Dave
Top achievements
Rank 1
 answered on 13 Dec 2018
1 answer
937 views

Subresource Integrity is a fairly new security scheme for protecting against malicious script obtained from third-party source (CDNs). It requires that the script tag include a hash of the script content so the browser can verify that it has not been altered.

Telerik controls generate a bunch of script tags for cloudfront.net. It would be swell if the script tags would include the extra attributes necessary to implement subresource integrity. Is this in the roadmap? 

Mozilla provides a security analysis tool which highlights this issue. Look at the results for telerik.com here

More info available here and here.

Rumen
Telerik team
 answered on 13 Dec 2018
5 answers
530 views

I added an editable grid on my page, based on forum posts I found on this site (see attached images). The grid works as expected; however, the filtering & sorting do not.

In edit mode, the grid has a few drop-down lists using <EditItemTemplate>. Unfortunately, the default filter for these columns ends up being a textbox instead of a drop-down list. How can I change them? Also, these fields lose their sorting capability - the column headers can't be clicked, like the other columns in the grid.

If I change the tag from <EditItemTemplate> to <FilterTemplate> the filter becomes a drop-down list; but, then the fields are no longer listed on the edit screen (see attached image). 

How can I implement a grid that has both capabilities - a drop-down for editing & for filtering?

 

This is how I've implemented things...

ASPX page

<telerik:RadGrid ID="RadGrid2" RenderMode="Lightweight" runat="server" AutoGenerateColumns="false" AllowSorting="True" AllowPaging="True" ShowStatusBar="true" OnItemDataBound="RadGrid2_ItemDataBound" AllowFilteringByColumn="True" >

    <MasterTableView Name="PlantTypeGrid" DataKeyNames="ID" CommandItemDisplay="Top" ShowFooter="false" >
        <HeaderStyle Font-Bold="true"/>
        <Columns>
            <telerik:GridEditCommandColumn ButtonType="FontIconButton" />
            <telerik:GridCheckBoxColumn DataField="Active" HeaderText="Active" />
            <telerik:GridBoundColumn DataField="Description" HeaderText="Description" AllowFiltering="false" />
            <telerik:GridTemplateColumn HeaderText="Process Unit Category" UniqueName="ProcessUnitCategoryID" AllowFiltering="true" >
                <EditItemTemplate>
                    <telerik:RadDropDownList runat="server" ID="ddlProcessUnitCatTelerik" AppendDataBoundItems="true" >
                    </telerik:RadDropDownList>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridButtonColumn ConfirmText="Delete this Plant Type?" ConfirmDialogType="RadWindow" ConfirmTitle="Delete" CommandName="Delete" ButtonType="FontIconButton" />
        </Columns>
    </MasterTableView>
    <PagerStyle Mode="NextPrevAndNumeric" />
  </telerik:RadGrid>

VB Page

Private Sub BuildPlantTypeGrid()
    Dim myCollection As EMSLookupItems = Nothing
    myCollection = _lookupMgr.GetPlantTypes(-1, -1)
    If Not myCollection.Count = 0 Then
        RadGrid2.DataSource = myCollection.Items
    Else
        RadGrid2.DataSource = ""
    End If
End Sub

Protected Sub RadGrid2_ItemDataBound(ByVal sender As Object, ByVal e As GridItemEventArgs)

    If TypeOf e.Item Is GridEditableItem Then
        If e.Item.IsInEditMode Then
            Dim item As GridEditableItem = CType(e.Item, GridEditableItem)
            Dim mySubCollection As EMSLookupItems = Nothing
            Dim ddlProcessUnitCatTelerik As RadDropDownList = CType(item.FindControl("ddlProcessUnitCatTelerik"), RadDropDownList)
            ddlProcessUnitCatTelerik.Width = Unit.Pixel(300)

            If Not ddlProcessUnitCatTelerik Is Nothing Then
                mySubCollection = _lookupMgr.GetLookupValues("PROCESS_UNIT_CATEGORIES")
                If Not mySubCollection.Count = 0 Then
                    ddlProcessUnitCatTelerik.DataSource = mySubCollection.Items
                    ddlProcessUnitCatTelerik.DataValueField = "ID"
                    ddlProcessUnitCatTelerik.DataTextField = "Description"
                Else
                    ddlProcessUnitCatTelerik.DataSource = ""
                End If
                ddlProcessUnitCatTelerik.DataBind()
                ddlProcessUnitCatTelerik.Items.Insert(0, "Please Select...")
            End If
        End If
    End If
End Sub

 

Attila Antal
Telerik team
 answered on 13 Dec 2018
4 answers
211 views

I have a RadMenu that I've set up for lightweight rendering. I have the following on the page to remove the icon column:

div.RadMenu .rmGroup:before
{
    width: 0px; /*remove the colored stripe from the left side*/
}
 
div.RadMenu .rmGroup .rmLink
{
    padding-left: 0px; /*remove the text padding from the left side*/
}
 
div.RadMenu .rmGroup .rmSeparator
{
    margin-left: 0px;/*stretch the separator*/
}

 

This works great except for the first menu item. Due to its length, I have that menu set as a two-column menu. Unfortunately, the background for the icon column continues to show up in the first column of this menu item (see the attached screenshot.) I found that I can turn off this background by unchecking .RadMenu .rmGroup.rmMultiGroup in the DOM explorer in my browser, but when I set that to:

 

.RadMenu .rmGroup.rmMultiGroup {
    background: none;
}

 

the background continues to show up.

What should I be doing to get rid of this column?

Thank you!

bdrennen
Top achievements
Rank 1
 answered on 13 Dec 2018
1 answer
243 views
I need to disable some rows in grid view based on the condition. i tried to disable the row. But when i click on row then it's getting highlighted and able to edit.
Vessy
Telerik team
 answered on 13 Dec 2018
2 answers
1.3K+ views
Hello,I have a radgrid with some bound columns. In one of the bound columns, it has ImageButton. All I want is Javascript function when I click the button i want to get value of this row of the button.

It means when I click ImageButton 'CizelgeAc' I want to get EKD_ID of this selected row. my javascript function is 'cizelgeAc1(this,event)


<telerik:GridTemplateColumn HeaderText="Kurs Prog. Çiz." UniqueName="KursProgCiz" DataField="EKD_ID" SortExpression="EKD_ID" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" AllowFiltering="false">
                                                <ItemTemplate>
                                                    <asp:ImageButton ID="CizelgeAc" CommandName="ES" runat="server" CausesValidation="false" OnClientClick="cizelgeAc1(this,event)"
                                                        Visible='<%# (((((string)Eval("EGT_TIPI").ToString() == "V"))) ? true : false) %>'
                                                        ImageUrl="~/Images/AddRecord.gif" />
                                                    <asp:Label runat="server" Visible='<%# (((((string)Eval("EGT_TIPI").ToString() == "A"))) ? true : false) %>' Text="-"></asp:Label>
                                                    <%--                                                    <asp:Image ID="imageKursProgCiz" runat="server" ImageUrl="~/Images/Cancel.gif" Visible='<%# (((((string)Eval("EGT_TIPI").ToString() == "A"))) ? true : false) %>' />                                                  --%>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>

Javascript Function : 

function cizelgeAc1(button, args) {
                var row = Telerik.Web.UI.Grid.GetFirstParentByTagName(button, "tr");
                //guarantee to get to the table row
                while (!(row.id && row.id.indexOf("__") > -1)) {
                    row = Telerik.Web.UI.Grid.GetFirstParentByTagName(button, "tr");
                }
 
                //get index
                var index = row.id.split("__")[1];
 
                //get all table data items
                var tableId = row.id.split("__")[0];
                var tableView = $find(tableId);
                tableView.get_dataItems();
                //find the data item related to the row id
                var dataItem = $find(row.id);
                var grid = button;
                var MasterTable = EgitimTalepleriRadGrid.get_masterTableView();
                 var cell= grid.get_masterTableView().get_dataItems()[0].get_cell("EKD_ID").innerHTML;
 
            }

I got the row index but I couldn't reach value of 'EKD_ID' in this way.

Ilaya
Top achievements
Rank 1
 answered on 13 Dec 2018
1 answer
88 views

     Is it possible to have it highlight the 1st level a color, the side and then add padding to to wrap it in the same   Similar to this example

https://cdn.shopify.com/s/files/1/0035/7279/3459/files/microbit-if-statement-for-robots-button-is-pressed_large.png?v=1530304913

 

The blue being the 1st level and the green being the 2nd level.

 

Attached a grid we are currently using with the blue square where we want it to be a blue background.

 

Marin Bratanov
Telerik team
 answered on 12 Dec 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?