Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
609 views

Hi,

I am fairly new to Telerik controls and was experimenting with radtooltip and radtooltipmanager.

 

I created a tooltipmanager and a radtooltip from code behind with ID = "Test", rendermode = lightweight, title = "properties" and text = "CheckText". And this worked.

But when I went to add a radlabel I created as a control to it, saying

RTP.Controls.Add(radlabel1)

it wouldn't display it.

Can someone help me figure how to add controls to radtooltip or radtooltipmanager?

(Eventually, I want to add more controls like a table in the tooltip)

 

Thanks in advanced,

Swanand Nalawade

Vessy
Telerik team
 answered on 29 Apr 2020
2 answers
170 views

I am having an issue trying the get a radcontextmenu appear above a radmenu.  

Following the instruction about positioning controls from  https://docs.telerik.com/devtools/aspnet-ajax/controls/controlling-absolute-positioning-with-z-index

The appearance is correct on IE 11 and Edge, but appears as attached when viewed in Chrome.  

The deckaration for RadContextMenu:

 

  <telerik:RadContextMenu ID="RadContextMenu1" runat="server" Skin="Black1" EnableEmbeddedSkins="false"    RenderMode="Lightweight"    style="z-index:483647"  >
  <Items>
      <telerik:RadMenuItem>
      


      </telerik:RadMenuItem>

  </Items>
                                
                                        
</telerik:RadContextMenu>

The declaration for The Radmenu:

 <telerik:RadMenu ID="RadMenu1" runat="server"   Skin="Default"   RenderMode="Lightweight"  style="z-index: 12345"  OnItemClick="RadMenu1_ItemClick">
</telerik:RadMenu>

 

I don't think I am missing any thing.   

Brete
Top achievements
Rank 1
 answered on 29 Apr 2020
10 answers
734 views
I use client js method "startSpellCheck(); " to check spelling, it works fine when the text is small, but when the text content is large, for example 30k+ lines, an error page pop up:

 
Spell Check handler server error: 500<br><br><title>...The length of the string exceeds the value set on the maxJsonLength property.</title><br>...


I have set the maxJsonLength to a big value in web.config, but it seems that the spell check ignore the setting.
...

<system.web.extensions><br>    <scripting><br>      <webServices>       <br>        <jsonSerialization maxJsonLength="2147483644"></jsonSerialization><br>      </webServices><br>    </scripting><br>  </system.web.extensions>

Rumen
Telerik team
 answered on 29 Apr 2020
1 answer
165 views

There is no server event that gets triggered when a user uses the clear function. The logical event would be to trigger the SelectedIndexChanged since it is essentially going from a value to nothing, therefore changing the selected index.  I'm sure that since the world is slowly trying to forget about server programming and concentrating on Java that there is some java solution that won't do me a hill of bean worth of good.  

My point, would it be so bad to have the clear function trigger something?

Peter Milchev
Telerik team
 answered on 29 Apr 2020
3 answers
600 views
I'm not able to get my RadComboBox to blur when interacting with the mouse. I have the control extended to incorporate a RadTreeView (as in http://demos.telerik.com/aspnet-ajax/treeview/examples/functionality/treeviewcombobox/defaultcs.aspx?product=combobox), with some enhancements.

I have 2 use cases:
1) A user types text and the treeview is filtered as they type (all my code). They can use the arrows keys to change selections in the TreeView and hit enter to select it. The selection doesn't actually go into the ComboBox because I allow multiple selections, so after they hit enter, the item they selected is added to a table and focus drops.
After this, the ComboBox shows its empty message and the cursor disappears from the input area of the ComboBox.

2) A user types text and the treeview is filtered (as above). They can use the mouse to click an item and add it to the list.
After this, the ComboBox closes but the empty message doesn't not show. The cursor is in an empty input region in the ComboBox.

My goal is for case #2 to also drop focus on the combobox after they click, but no matter what I do, I can't get the combobox to blur until I click elsewhere on the page with the mouse.

I've tried the solutions offered in http://www.telerik.com/community/forums/aspnet-ajax/combobox/removing-combobox-focus.aspx and have tried calling this function after the item is clicked:

function BlurComboBox(comboBox) {
    if (comboBox.get_dropDownVisible() && comboBox.get_closeDropDownOnBlur())
        comboBox.hideDropDown();
 
    comboBox.get_tableElement().className = "";
    comboBox._selectItemOnBlur();
    comboBox.get_inputDomElement().blur();
    comboBox._raiseClientBlur(window.event);
    comboBox._focused = false;
}

The function executes but nothing ever changes in the combobox.

I can't just set focus elsewhere on the page - that doesn't make sense. I just want to blur the combobox so its state resets.

How can I do this?
Vessy
Telerik team
 answered on 29 Apr 2020
1 answer
165 views

Hi,

 

I am trying to implement a Batch Edit mode in a RadGrid from a DataTable say Documents. RadGrid is being generated from the code behind.

Documents datatable has 2 different columns say DocumentType as string and Publish Status as int which I want to be displayed as GridDropDownColumns.

I am also creating 2 other datatables for reference values of these columns.

Document type refers value and text to one column (TEXTValue) in it's reference datatable.

Publish Status refers value to one column (PublishID) and text to another column (TEXTValue)  in it's reference table.

For Cell value changed of the radgrid, I am running a javascript function which I got from telerik forms to save changes.

 

Problem:

The Document type column which refers both value and text to same column works fine but the Publish Status column which refers to 2 different columns for value and text field gets stuck in an infinite loop running the javascript function without making any saves to the database.

 

Can someone help me with figuring this problem out?

 

Thanks in advance,
Swanand Nalawade

Eyup
Telerik team
 answered on 29 Apr 2020
5 answers
1.6K+ views

Recently I submitted a support ticket to find out how I could change the color of the text of a RadCheckBox. I'm not as fluent in css as I should be so I thought I would share my findings for others like me with limited css skills.

To change the color of the text of all checkboxes on the page create the following css rule

<style>
    .rbText  {
       color: red !important;
    }
</style>

If you need to change the color of only some checkboxes (in my case I have a couple that are required and I wanted to make the red leaving all others black) you can create a rule that looks like this

<style>
    .required .rbText  {
       color: red !important;
    }
</style>

and then assign the required css class to the checkbox like this

<telerik:RadCheckBox ID="blnCorrectiveAction" runat="server" Text="Corrective Action Necessary" CssClass="required"></telerik:RadCheckBox>

I'm sure the css pros think this is silly simple thing so say but for those of us that struggle I hope this helps 

Brian
Top achievements
Rank 2
Veteran
 answered on 28 Apr 2020
9 answers
278 views

Hello

i just added a Confirmation Dialog to my Radgrid using the radgrid.radconfirm. This works perfectly, but after that the Radgrid is not updated, like it still shows the deleted entry. Refreshing the page obv helps. I already tested the following:

Use advanced binding instead of simple binding.

Change to type BindingList instead of List as Datasourcetype

RadAjaxManager instead of RadAjaxPanel is not possible, because the panel is need as part of the whole concept of the webpage and to ensure that each user is only able to see what he is allowed to see.

Here is the code: ASPX

<%@ Page Title="News - Administration" Language="C#" MasterPageFile="~/AppMaster.master" AutoEventWireup="true" Inherits="News" CodeBehind="News.aspx.cs" %>
 
<%@ Register Src="NewsDetails.ascx" TagName="NewsDetails" TagPrefix="uc" %>
<asp:Content ID="Content" ContentPlaceHolderID="PlaceHolderContent" runat="Server">
  <asp:Label ID="LabelRead" runat="server" Text="<%$Resources:Labels, NoReadRight %>" Visible="false" CssClass="Labels" />
    <asp:Label ID="LabelConfirm" runat="server" Text="<%$Resources:Labels, NoReadRight %>" Visible="false" CssClass="Labels" />
     
    <telerik:RadWindowManager RenderMode="Lightweight" ID="confirmWindow" runat="server" EnableShadow="true">
        </telerik:RadWindowManager>
    <%--RadAjaxPanel--%>
    <telerik:RadAjaxPanel ID="PanelRead" runat="server" LoadingPanelID="RadAjaxLoadingPanel" Visible="false">
        <telerik:RadGrid ID="RadGrid" runat="server" AutoGenerateColumns="False" GridLines="None"
            AllowPaging="true" PageSize="20" Width="950px"
            OnItemCommand="RadGrid_ItemCommand" OnInsertCommand="RadGrid_InsertCommand" OnDeleteCommand="RadGrid_DeleteCommand"
            OnUpdateCommand="RadGrid_UpdateCommand">
            <MasterTableView Datasource="ObjectDataSourceNewsEntries" DataKeyNames="NewsEntryID"
                CommandItemDisplay="Top">
                <CommandItemSettings ShowRefreshButton="false" ShowAddNewRecordButton="true" AddNewRecordText="Neuer News-Eintrag" />
                <Columns>
                    <%--TimestampString --%>
                    <telerik:GridBoundColumn DataField="TimestampString" HeaderText='<%$Resources:Labels, NewsEntryTimestamp %>'
                        UniqueName="TimestampString" DataFormatString="{0}" DataType="System.String"
                        Display="true" Groupable="false">
                        <HeaderStyle Width="50px" HorizontalAlign="Left" VerticalAlign="Top" Font-Bold="false" />
                        <ItemStyle Wrap="false" HorizontalAlign="Left" VerticalAlign="Top" Font-Bold="false" />
                    </telerik:GridBoundColumn>
                    <%--HeaderText --%>
                    <telerik:GridBoundColumn DataField="HeaderText" HeaderText='<%$Resources:Labels, HeaderText %>'
                        UniqueName="HeaderText" DataFormatString="{0}" DataType="System.String" Display="true"
                        Groupable="false">
                        <HeaderStyle Width="330px" HorizontalAlign="Left" VerticalAlign="Top" Font-Bold="false" />
                        <ItemStyle Wrap="false" HorizontalAlign="Left" VerticalAlign="Top" Font-Bold="false" />
                    </telerik:GridBoundColumn>
                    <%--IsActive --%>
                    <telerik:GridBoundColumn DataField="IsActive" HeaderText='<%$Resources:Labels, IsActive %>'
                        UniqueName="IsActive" DataFormatString="" DataType="System.Boolean" Display="true"
                        Groupable="false">
                        <HeaderStyle Width="50px" HorizontalAlign="Left" VerticalAlign="Top" Font-Bold="false" />
                        <ItemStyle Wrap="false" HorizontalAlign="Left" VerticalAlign="Top" Font-Bold="false" />
                    </telerik:GridBoundColumn>
                    <%--ErstellerUserNameVorname --%>
                    <telerik:GridBoundColumn DataField="ErstellerUserNameVorname" HeaderText='<%$Resources:Labels, ErstellerUserNameVorname %>'
                        UniqueName="ErstellerUserNameVorname" DataFormatString="{0}" DataType="System.String"
                        Display="true" Groupable="false">
                        <HeaderStyle Width="170px" HorizontalAlign="Left" VerticalAlign="Top" Font-Bold="false" />
                        <ItemStyle Wrap="false" HorizontalAlign="Left" VerticalAlign="Top" Font-Bold="false" />
                    </telerik:GridBoundColumn>
                    <%--AenderungsUserNameVorname --%>
                    <telerik:GridBoundColumn DataField="AenderungsUserNameVorname" HeaderText='<%$Resources:Labels, AenderungsUserNameVorname %>'
                        UniqueName="AenderungsUserNameVorname" DataFormatString="{0}" DataType="System.String"
                        Display="true" Groupable="false">
                        <HeaderStyle Width="170px" HorizontalAlign="Left" VerticalAlign="Top" Font-Bold="false" />
                        <ItemStyle Wrap="false" HorizontalAlign="Left" VerticalAlign="Top" Font-Bold="false" />
                    </telerik:GridBoundColumn>
                    <%--Aenderungsdatum --%>
                    <telerik:GridBoundColumn DataField="Aenderungsdatum" HeaderText='<%$Resources:Labels, Aenderungsdatum %>'
                        UniqueName="Aenderungsdatum" DataFormatString="{0}" DataType="System.String"
                        Display="true" Groupable="false">
                        <HeaderStyle Width="80px" HorizontalAlign="Left" VerticalAlign="Top" Font-Bold="false" />
                        <ItemStyle Wrap="false" HorizontalAlign="Left" VerticalAlign="Top" Font-Bold="false" />
                    </telerik:GridBoundColumn>
                    <%--LinkButtonEditCommand--%>
                    <telerik:GridTemplateColumn UniqueName="ColumnEditCommand">
                        <HeaderStyle Width="25px" />
                        <ItemStyle HorizontalAlign="Center" />
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButtonEditCommand" runat="server" CommandName="Edit" ToolTip="<%$Resources:Labels, Edit %>">
                                <asp:Image ID="ImageEditCommand" runat="server" ImageUrl="~/App_Themes/Controlling/EditIcon.gif" />
                            </asp:LinkButton>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <%--LinkButtonDeleteCommand--%>
                    <telerik:GridTemplateColumn UniqueName="ColumnDeleteCommand">
                        <HeaderStyle Width="25px" />
                        <ItemStyle HorizontalAlign="Center" />
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButtonDeleteCommand" runat="server" CommandName="Delete"
                                ToolTip="<%$Resources:Labels, DeleteToolTip %>">
                                <asp:Image ID="ImageDeleteCommand" runat="server" ImageUrl="~/App_Themes/Controlling/DeleteIcon.png" />
                            </asp:LinkButton>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                </Columns>
                <NestedViewTemplate>
                    <uc:NewsDetails ID="NewsDetails" runat="server" />
                </NestedViewTemplate>
                <EditFormSettings UserControlName="NewsCreateUpdate.ascx" EditFormType="WebUserControl">
                    <EditColumn UniqueName="NewsCreateUpdateColumn"></EditColumn>
                </EditFormSettings>
            </MasterTableView>
        </telerik:RadGrid>
    </telerik:RadAjaxPanel>
    <%--DataSources--%>
    <asp:ObjectDataSource ID="ObjectDataSourceNewsEntries" runat="server" SelectMethod="GetNewsEntries" TypeName="PortalDataServiceWrapper" />
</asp:Content>

 

C#

using System;
using System.Web.Services;
using Telekom.Platon.PortalModel;
using Telekom.Platon.Web.Code.Base;
using Telekom.PORTAL.Web;
using Telerik.Web.UI;
 
 
public partial class News : AppBasePage
{
    protected override ModulEnum ModulId => ModulEnum.AdminNews;
    protected static Guid GridID = Guid.Empty;
    protected static News n;
    protected static RadGrid RGrid;
 
 
    protected void Page_Load(object sender, EventArgs e)
    {
        PanelRead.Visible = MayRead;
        LabelRead.Visible = !MayRead;
 
        RadScriptManager.RegisterClientScriptInclude(Page.Master, Page.Master.GetType(), "ConfirmRadWindow", ResolveClientUrl("~/Scripts/app/ConfirmRadWindow.js"));
 
 
        if (!Page.IsPostBack)
            DataBind();
    }
 
    protected void RadGrid_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
    {
        if (e.CommandName == Telerik.Web.UI.RadGrid.ExpandCollapseCommandName)
        {
            //
            // Expand
            //
            GridDataItem gridDataItem = e.Item as GridDataItem;
 
            string newsEntryIDString = gridDataItem.GetDataKeyValue("NewsEntryID").ToString();
            Guid newsEntryID = new Guid(newsEntryIDString);
 
            NewsEntry dataItem = PortalDataService.GetNewsEntry(newsEntryID);
 
 
            if (!e.Item.Expanded)
            {
                NewsDetails control = (NewsDetails)gridDataItem.ChildItem.FindControl("NewsDetails");
 
                if (control != null &&
                        dataItem != null)
                {
                    control.State.FormattedContent = dataItem.FormattedContent;
                    control.DataBind();
                }
            }
        }
    }
 
    protected void RadGrid_InsertCommand(object sender, GridCommandEventArgs e)
    {
        GridEditableItem editedItem = e.Item as GridEditableItem;
        NewsCreateUpdate userControl = (NewsCreateUpdate)editedItem.FindControl(GridEditFormItem.EditFormUserControlID);
 
        if (userControl.Timestamp.HasValue) Create(userControl.Timestamp.Value, userControl.HeaderText, userControl.IsActive, userControl.FormattedContent);
    }
 
    protected void RadGrid_UpdateCommand(object sender, GridCommandEventArgs e)
    {
        GridEditableItem editedItem = e.Item as GridEditableItem;
        NewsCreateUpdate userControl = (NewsCreateUpdate)editedItem.FindControl(GridEditFormItem.EditFormUserControlID);
        Guid newsEntryID = GridUtil.GetValue<Guid>("NewsEntryID", e);
 
        if (userControl.Timestamp.HasValue) Update(newsEntryID, userControl.Timestamp.Value, userControl.HeaderText, userControl.IsActive, userControl.FormattedContent);
    }
 
    protected void RadGrid_DeleteCommand(object sender, GridCommandEventArgs e)
    {
        GridID = GridUtil.GetValue<Guid>("NewsEntryID", e);
        RGrid = this.RadGrid;
        n = this;
 
        if (Page.IsValid)
        {
            confirmWindow.RadConfirm("Sind Sie sicher das diese News gelöscht werden soll?", "confirmCallBackFn", 330, 180, null, "Newsmeldung löschen?");
        }
 
    }
 
    private void Create(DateTime timestamp, string headerText, bool isActive, string formattedContent)
    {
        if (Page.IsValid)
        {
            string userID = SecurityService.GetUserID();
 
            NewsEntry newsEntry = NewsEntry.Create(timestamp, headerText, isActive, userID);
 
            if (newsEntry != null)
            {
                newsEntry.FormattedContent = formattedContent;
 
                string message = string.Empty;
                PortalDataService.CreateNewsEntry(newsEntry, out message);
 
                RadGrid.DataBind();
                RadGrid.CurrentPageIndex = 0;
            }
        }
    }
 
    private void Update(Guid newsEntryID, DateTime timestamp, string headerText, bool isActive, string formattedContent)
    {
        if (Page.IsValid)
        {
            string userID = SecurityService.GetUserID();
            NewsEntry newsEntry = PortalDataService.GetNewsEntry(newsEntryID);
 
            if (newsEntry != null)
            {
                newsEntry.Timestamp = timestamp;
                newsEntry.HeaderText = headerText;
                newsEntry.FormattedContent = formattedContent;
                newsEntry.IsActive = isActive;
                newsEntry.Aenderungsdatum = DateTime.Now;
                newsEntry.AenderungsUserID = userID;
 
                PortalDataService.UpdateNewsEntry(newsEntry);
 
                RadGrid.DataBind();
            }
        }
    }
 
    [WebMethod]
    public static void Delete(bool? UserReponse)
    {
        if (GridID != Guid.Empty && UserReponse.Equals(true))
        {
            PortalDataService.DeleteNewsEntry(GridID);
            RGrid.DataBind();
 
 
 
        }
    }
}

 

Any Ideas what i can do?

Regards Michael

Peter Milchev
Telerik team
 answered on 28 Apr 2020
3 answers
210 views
Is it possible to set the PageSizeText through code when using the RadDataPager for a RadListView?
Doncho
Telerik team
 answered on 28 Apr 2020
1 answer
675 views

     I've been working on resolving a Telerik vulnerability in our site that is using version 2015.3.1111.45 of Telerik.Web.UI (see https://www.telerik.com/support/kb/aspnet-ajax/details/cryptographic-weakness).  I've applied the patched dll to the site, so now when our tester tries the exploit, she gets an error page that says "Cannot deserialize dialog parameters. Please refresh the editor page.
Error Message:The hash is not valid!"  Our security group is not happy with that error page and wants to see something more generic and less revealing to the would-be hacker.  Our ASP.NET MVC application is configured in the web.config to have "customErrorsMode" set to "On" so that any unhandled errors will automatically redirect the user to a very generic and static html error page.  Unfortunately even with this set in our production environment, we are still getting the "Cannot deserialize dialog parameters....." error... presumably being generated by Telerik somehow.

Can you provide a solution on how to customize this error message or get around it so that it will fall though to the .NET error handling of the web application itself?

Rumen
Telerik team
 answered on 27 Apr 2020
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?