Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
193 views
I have a radgrid that displays number values'

Is it possible to scan the entire grid and highlight all cells who's value is great than say 100?
Konstantin Dikov
Telerik team
 answered on 07 Oct 2014
1 answer
191 views
Is there a way to disable the text box visually and from editing using javascript? I was using the radComboBox and it had the .disable() & .enable() functions. I see AutoCompleteBox has the set_enabled(i) however the control appearance is still enabled.
Nencho
Telerik team
 answered on 07 Oct 2014
1 answer
232 views
Hello all..

I have the following peculiar problem.

aspx
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">
          </telerik:RadWindowManager>

<telerik:RadNotification ID="n1" runat="server" Text="" Position="Center"
    AutoCloseDelay="5000" Width="450" Title="" KeepOnMouseOver="true"
    EnableRoundedCorners="true" Animation="Resize" ContentIcon="warning"
    AnimationDuration="700" TitleIcon="none" Font-Size="12px" Font-Bold="True"
    ShowCloseButton ="true">
</telerik:RadNotification>

vb
  Protected Sub grdTenders_DeleteCommand(sender As Object, e As GridCommandEventArgs)

     ... code to set the value of <res> below

    If res = 1 Then
      n1.Title = "Error Deleting"
      n1.Text = "Cannot delete this tender. It has been sent out to at least 1 Manufacturer!"
      n1.Show()
      Exit Sub
    End If

...and further down

Protected Sub grdTenDetails_ItemCommand(sender As Object, e As GridCommandEventArgs)

     ... again code to set the value of res below

    If res = 1 Then
      n1.Title = "Error Editing"
      n1.Text = "Cannot Edit this tender. It has been sent out to at least 1 Manufacturer!"
      n1.Show() 
        e.Canceled = True
        Exit Sub
      End If


The first notification works fine.
The second time the notification should be shown (on the second sub) the window pops up without title or text!
It is functional, but the values for <title> and <text> remain the default ones (empty)
I stopped the code in n1.Show() and the values are correct. Then I continue the code and still no text/title.

I even tried to add another notification (r2) on the page and changed the code on the second sub, but still the second window comes up empty!


Any information would be appreciated...




Marin Bratanov
Telerik team
 answered on 07 Oct 2014
11 answers
315 views
Hi,

  I am highlighting first menu item from codebehind by: RadMenu1.Items(0).HighlightPath(). That works as expected.

However, when i am trying to do the same from Javascript i struggle.

I tried:

  function RadMenu1_OnClientItemClicking(sender, eventArgs) {     

          var item = eventArgs.get_item();      
          item.set_selected(true)

This results in both menu items highlighted. Additional problem that when i click outside menu, second item of menu looses it highlight state, but first item stays highlighted.

Another way i tried

         var menu = $find("<%= RadMenu1.ClientID %>");
          var firstItem = menu.get_items().getItem(0).set_selected(true);
          var secondItem = menu.get_items().getItem(1).set_selected(false);
          menu.commitChanges();

Kinda same issues.

Please advice
Boyan Dimitrov
Telerik team
 answered on 07 Oct 2014
2 answers
175 views
Hello all,

I have:

in .aspx
 <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">
          </telerik:RadWindowManager>
  <script type="text/javascript">
    function confirmCallbackFn(arg) {
      if (arg) { //the user clicked OK
      __doPostBack("<%=HiddenButton.UniqueID %>", "");
      }
    }

    </script>
 
<div id="divMain" style="position: relative; top: 0px;">
<asp:Button ID="HiddenButton" Text="" OnClick="HiddenButton_Click"
  runat="server" Visible="False" />

....



in the code (inside a delete event of a radgrid)
RadWindowManager1.RadConfirm("Delete this Tender?", "confirmCallBackFn", 330, 180, Nothing, "Confirm")

...and

Protected Sub HiddenButton_Click(sender As Object, e As System.EventArgs) Handles HiddenButton.Click
...the actual code which deletes the Tender from the database
End Sub


While the RadConfirm does get executed, the radconfirm window is not appearing on the page.

Could you please point out my mistake?

Thanks






    


Dimitrios
Top achievements
Rank 1
 answered on 07 Oct 2014
2 answers
147 views
Hi all,
Please help me.
When i use RadCombobox control in filter the column, I get an error:
Selection out of range
Parameter name: value
Exception Details: System.ArgumentOutOfRangeException: Selection out of range
Parameter name: value

1. .aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:ScriptManager ID="sm" runat="server"></asp:ScriptManager>
            <telerik:RadGrid ID="RadGrid1" ShowGroupPanel="false" runat="server" AutoGenerateColumns="False" AllowFilteringByColumn="true" PageSize="3" EnableLinqExpressions="true">
                <ClientSettings>
                    <Resizing AllowColumnResize="true" EnableRealTimeResize="true" />
                    <Scrolling AllowScroll="true" />
                </ClientSettings>
                <MasterTableView>
                    <ColumnGroups>
                        <telerik:GridColumnGroup Name="Left" HeaderText="LEFT" HeaderStyle-HorizontalAlign="Center">
                            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                        </telerik:GridColumnGroup>
                        <telerik:GridColumnGroup Name="Center" HeaderText="CENTER" ParentGroupName="Left"></telerik:GridColumnGroup>
                        <telerik:GridColumnGroup Name="Right" HeaderText="RIGHT" ParentGroupName="Left"></telerik:GridColumnGroup>
                    </ColumnGroups>
                    <Columns>
                        <telerik:GridBoundColumn DataField="A" HeaderText="AAA" HeaderStyle-HorizontalAlign="Center" ColumnGroupName="Left">
                            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                            <FilterTemplate>
                                <telerik:RadComboBox ID="cbFilterUserSPIMI" AppendDataBoundItems="true" runat="server"
                                    Height="150px" Width="110px" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("A").CurrentFilterValue %>'
                                    OnClientSelectedIndexChanged="IndexChangedUserSPIMI" OnInit="cbFilterUserSPIMI_Init">
                                    <Items>
                                        <telerik:RadComboBoxItem Text="All" />
                                    </Items>
                                </telerik:RadComboBox>
                                <telerik:RadScriptBlock ID="RDFilterScriptBlockUserSPIMI" runat="server">
                                    <script type="text/javascript">
                                        function IndexChangedUserSPIMI(sender, args) {
                                            var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID%>");
                                            tableView.filter("A", args.get_item().get_value(), "EqualTo");
                                        }
                                    </script>
                                </telerik:RadScriptBlock>
                            </FilterTemplate>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="B" HeaderText="BBB" HeaderStyle-HorizontalAlign="Center" ColumnGroupName="Left">
                            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                            <FilterTemplate>
                                <telerik:RadComboBox ID="cbFilterB" AppendDataBoundItems="true" runat="server" Height="150px" Width="110px"
                                    SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("B").CurrentFilterValue %>' OnClientSelectedIndexChanged="IndexChangeBBB"
                                    OnInit="cbFilterB_Init">
                                    <Items>
                                        <telerik:RadComboBoxItem Text="All" />
                                    </Items>
                                </telerik:RadComboBox>
                                <telerik:RadScriptBlock ID="RDBlockforB" runat="server">
                                    <script type="text/javascript">
                                        function IndexChangeBBB(sender, args) {
                                            var tableView = $find("<%#((GridItem)Container).OwnerTableView.ClientID%>");
                                            tableView.filter("B", args.get_item().get_value(), "EqualTo");
                                        }
                                    </script>
                                </telerik:RadScriptBlock>
                            </FilterTemplate>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="C" HeaderText="CCC" HeaderStyle-HorizontalAlign="Center" ColumnGroupName="Center">
                            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="D" HeaderText="DDD" HeaderStyle-HorizontalAlign="Center" ColumnGroupName="Right">
                            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="E" HeaderText="EEE" HeaderStyle-HorizontalAlign="Center" ColumnGroupName="Right">
                            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                        </telerik:GridBoundColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>
        </div>
    </form>
</body>
</html>

2. codebehind

using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;

namespace WebApplication1
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            RadGrid1.DataSource = GetDB();
            RadGrid1.DataBind();
        }

        protected DataTable GetDB()
        {
            DataTable dtb = new DataTable();

            dtb.Columns.Add("A", typeof(string));
            dtb.Columns.Add("B", typeof(string));
            dtb.Columns.Add("C", typeof(string));
            dtb.Columns.Add("D", typeof(string));
            dtb.Columns.Add("E", typeof(string));

            DataRow dr;

            for (int i = 0; i < 3; i++)
            {
                dr = dtb.NewRow();

                if (i < 1)
                {
                    dr[0] = @"Demo-A\abc";
                    dr[1] = "BBB Demo";
                    dr[2] = "Demo CCC";
                    dr[3] = "DDD Demo";
                    dr[4] = "Demo EEE";
                }
                else if (i == 1)
                {
                    dr[0] = "A/u1010";
                    dr[1] = "BBB*/u2020";
                    dr[2] = "Admid/CCC";
                    dr[3] = "DDD/&^u8080";
                    dr[4] = @"U5050\EEE";
                }
                else if (i == 2)
                {
                    dr[0] = "*&^%\u1011010";
                    dr[1] = "BBB/&^%$#@";
                    dr[2] = "$$$$$/CCC";
                    dr[3] = @"DDD\U56565656%";
                    dr[4] = "EEE/***(((";
                }

                dtb.Rows.Add(dr);
            }

                return dtb;
        }

        string temp = string.Empty;

        protected void cbFilterUserSPIMI_Init(object sender, EventArgs e)
        {

            RadComboBox combo = sender as RadComboBox;
            combo.DataSource = this.GetDB().AsEnumerable().Select(row => row.Field<string>("A")).Where(s => !string.IsNullOrEmpty(s)).Distinct().OrderBy(s => s);
        }

        protected void cbFilterB_Init(object sender, EventArgs e)
        {
            RadComboBox combo = sender as RadComboBox;
            combo.DataSource = this.GetDB().AsEnumerable().Select(row => row.Field<string>("B")).Where(s => !string.IsNullOrEmpty(s)).Distinct().OrderBy(s => s);
        }

    }
}

Thank you very much
Hung
Top achievements
Rank 1
 answered on 07 Oct 2014
1 answer
113 views
I have a RibbonBarSplitButton containing three RibbonBarButton items. If I set the SplitButton to enabled and the child Buttons to disabled, the SplitButton uses the disabled image, even though the control itself is enabled.

If I dynamically set the first button to enabled, the SplitButton image is not updated and still shows as disabled. After enabling the child button, I have to disable the SplitButton and then re-enable it for its image to change.

Is this a bug or am I missing something in how the controls are supposed to interact?

I am on Q2 2014 SP1

<telerik:RibbonBarSplitButton ID="testSplit" Text="Split Button" Size="Large" ImageUrlLarge="Enabled.png"
    DisabledImageUrlLarge="Disabled.png" ImageRenderingMode="Dual" Enabled="true" >
    <Buttons>
        <telerik:RibbonBarButton ID="testSub1" Text="Option 1" ImageUrl="MyIcon.png"
            DisabledImageUrl="MyIconDis.png" Enabled="false" Value="alert('Option 1 clicked')" />
        <telerik:RibbonBarButton ID="testSub2" Text="Option 2" ImageUrl="MyIcon.png"
            DisabledImageUrl="MyIconDis.png" Enabled="false" Value="alert('Option 2 clicked')" />
    </Buttons>
</telerik:RibbonBarSplitButton>
.
Derek
Top achievements
Rank 1
 answered on 06 Oct 2014
2 answers
210 views
Hello, I recently upgraded my Telerik project from .NET 4.0 to 4.5.1.
I' m having a lot of issues with jQuery.
Basically the following piece of markup 

    <telerik:RadScriptManager ID="_scriptManager" runat="server">
        <Scripts>
            <asp:ScriptReference Name="jquery" />
        </Scripts>
    </telerik:RadScriptManager>

in .NET 4.0 renders the jquery include, but in .NET 4.5 renders nothing, no jquery.

The only workaround I fond is to use the embedded Telerik jQuery.

    <telerik:RadScriptManager ID="_scriptManager" runat="server">
    </telerik:RadScriptManager>
    <script type="text/javascript">
        window.jQuery = window.$ = $telerik.$;
    </script>

Slav
Telerik team
 answered on 06 Oct 2014
2 answers
203 views
I recently implemented the SQL UDF/CLR solution found in this thread to help me with recurrence parsing:

http://blogs.telerik.com/aspnet-ajax/posts/08-08-04/working-with-radscheduler-recurring-appointments-on-sql-server.aspx

I am now getting the following error when running the store procedure that uses the UDF:

"Failed to open malformed assembly 'mscorlib' with HRESULT 0x80070008."

The error is directly related to the SP attempting to call the UDF.

I've included a copy of the stored procedure that is throwing the error.

Any ideas on what might be causing the issue?

CREATE PROCEDURE [dbo].[sp_Events_GetNext10EventsIncludeRecurring]
 
AS
BEGIN
    SET NOCOUNT ON;
 
    DECLARE @StartDate  DATETIME;
    DECLARE @EndDate    DATETIME;
 
    SET @StartDate = CAST(CONVERT(VARCHAR,GETDATE(),21) AS DATETIME);
    SET @EndDate = CAST(CONVERT(VARCHAR,GETDATE()+365,21) AS DATETIME);
     
-- List all appointments (recurring or not) in the given range
SELECT TOP 10 a.[EventID] as [EventID], a.[EventName] as [EventName], a.[Description] as [Description], a.[Location], ISNULL(o.StartDate, a.[StartDateTime]) as [StartDateTime], ISNULL(o.EndDate, a.[EndDateTime]) as [EndDateTime], a.[RecurrenceRule] as [RecurrenceRule], a.[RecurrenceParentID] as [RecurrenceParentID], a.[EventTypeID] as [EventTypeID], a.[EventType] as [EventType], a.[EventCategoryID] as [EventCategoryID], a.[EventCategory] as [EventCategory], a.[VenueID] as [VenueID], a.[VenueName] as [VenueName], a.[IsCityVenue] as [IsCityVenue], a.[RSVP] as [RSVP], a.[MinAttendees] as [MinAttendees], a.[MaxAttendees] as [MaxAttendees], a.[Notes] as [Notes], a.[AddedBy] as [AddedBy], a.[EditedBy] as [EditedBy], a.[DateAdded] as [DateAdded], a.[LastEdited] as [LastEdited], a.[Status] as [Status]
FROM    [vw_Details_Events_Active] a
    OUTER APPLY [dbo].[ExpandRecurrence](a.[RecurrenceRule], @Startdate, @EndDate) AS o
WHERE  
        -- Include non-recurring appointments in the range
        (a.[RecurrenceRule] IS NULL AND a.[StartDateTime] < @EndDate AND a.[EndDateTime] > @StartDate) OR
        -- And recurring appointments in range.
        (a.[RecurrenceRule] IS NOT NULL AND o.[StartDate] < @EndDate AND o.[EndDate] > @StartDate)
ORDER BY [StartDateTime]
 
 
END


Randy
Top achievements
Rank 1
 answered on 06 Oct 2014
2 answers
237 views
Hello,

I am working on a project with a RadMenu.
The RadMenuItem opens on mouse-click. It closes on any of the following: mouse-click on itself,
mouse-click on the screen, mouse-click on a different RadMenuItem inside the same RadMenu.

However, I have found a problem in this functionality:
First mouse-click - RadMenuItem opens.
Second mouse-click - RadMenuItem closes.
Third mouse-click - does nothing (should open again).
Fourth mouse-click - RadMenuItem opens again...

The problem is: why is it not responding to the third mouse-click?!
[Attached Video]

ASP.NET Code: 
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
  
                function ExternalitemOpened(s, e) {
                    if ($telerik.isIE8) {
                        // Fix an IE 8 bug that causes the list bullets to disappear (standards mode only)
                        $telerik.$("li", e.get_item().get_element())
                            .each(function () { this.style.cssText = this.style.cssText; });
                    }
                }
  
  
  
  
                function External_MouseOver(sender, args) {
                    if (args.get_item().get_parent() == sender) {
                        sender.set_clicked(false);
                    }
                }
  
  
                function ExternalOnClientItemClicking(sender, args) {
                    if (args.get_item().get_isOpen() == true) {
                        args.set_cancel(true);
                        args.get_item().close();
                    }
                }
  
  
  
  
            </script>
        </telerik:RadCodeBlock>
 
<telerik:RadMenu ID="RadMenu_SpecialReport" runat="server" ClickToOpen="True" EnableShadows="True" OnClientItemOpened="ExternalitemOpened" OnClientItemClicking="ExternalOnClientItemClicking" OnClientMouseOut="External_MouseOver" Style="top: 0px; left: -2px; z-index: 100; height: 35px;" Skin="ExternalGridButtons" EnableEmbeddedSkins="false">
                <Items>
                    <telerik:RadMenuItem PostBack="true" Text="Special Reports" Value="Special_Reports" CssClass="btn  btn-primary btn-menu-grid-size">
                        <ContentTemplate>
                            <div id="Special_panel" class="Special_panel" style="width:300px; height:500px; background-color:white;">
  
                                <telerik:RadAjaxPanel ID="RadAjaxPanel_SpecialReport" runat="server"  Width="80%"></telerik:RadAjaxPanel>
                                <telerik:RadButton ID="btn_ShowSpecialReport" runat="server" Text="Show Special Report" Skin="Web20" CssClass="btn_Sort" OnClick="btn_ShowSpecialReport_Click"></telerik:RadButton>
                            </div>
                        </ContentTemplate>
                    </telerik:RadMenuItem>
                     <telerik:RadMenuItem PostBack="true" Text="zzzz" Value="zzzzz" CssClass="btn  btn-primary btn-menu-grid-size">
                        <ContentTemplate>
                            <div id="Div1" class="Special_panel" style="width:300px; height:500px; background-color:white;">
  
                                <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server"  Width="80%"></telerik:RadAjaxPanel>
                                <telerik:RadButton ID="RadButton2" runat="server" Text="Show Special Report" Skin="Web20" CssClass="btn_Sort" OnClick="btn_ShowSpecialReport_Click"></telerik:RadButton>
                            </div>
                        </ContentTemplate>
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem IsSeparator="true"></telerik:RadMenuItem>
                </Items>
            </telerik:RadMenu>



How to solve this?

Thank you,
Daniel.
Daniel
Top achievements
Rank 1
 answered on 06 Oct 2014
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?