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

I am using telerik asp.net version 2014.2.618.35

I am using RadMenu which shows in Classic mode in desktop browser and in Mobile mode in mobile browser.

I am adding items to RadMenu at runtime and setting the CssClass property of RadMenuItem. In Classic mode it adds the css class to anchor tag <a> whereas in Mobile mode it adds the css class to list item tag <li>.

Is it possible to set the css class of anchor tag in Mobile mode?

The reason for adding a css class ("animsition-link") is to use Animsition jquery plugin for animated page transitions.

Thanks

Magdalena
Telerik team
 answered on 19 Oct 2016
1 answer
218 views

I have a RadScheduler to show a customer's sales records by date. At the top of the page, I have a table to select the customer. When I click to select the customer, I update the customer's other information on the page and update a session variable that I use to filter the RadScheduler.

The RadScheduler does not update with the new customer selected, however. It continues to show the first customer in the list (which populated the session variable on page load).

How do I trigger a refresh of the RadScheduler to pick up the new session variable value and refresh the RadScheduler?

Thanks!

Phil
Top achievements
Rank 1
 answered on 19 Oct 2016
5 answers
259 views
I am gettting the following error when using RadAjaxManager and an asp:LinkButton. 

Microsoft JScript runtime error: 'get_postBackElement().id' is null or not an object

However, if I invoke an Ajax call using the addNewClient button, and then I try and click the deleteClientLinkButton everything works fine.  It is just on the first page load that the error is thrown.

If I set ClientIdMode = AutoID for the page (http://www.telerik.com/community/forums/aspnet-ajax/ajax/radajax-broken-in-vs-2010-beta-2-in-master-content-pages.aspx) then the LinkButton works properly.  However, this renames all my controls and all my CSS is broken and no longer works.

Help please...

<asp:Content ID="Content1" ContentPlaceHolderID="headerContentPlaceholder" runat="Server">
    <script type="text/javascript">
        $(document).ready(function () {
            SetElements();
        });
 
        function SetElements() {
            //addNewClient
            $('#addNewClient').click(function () {
                $('#addNewClient').attr("disabled", true);
                $('#mainContentPlaceholder_newClientContainer').slideDown(function () {
                    $('#mainContentPlaceholder_newClientContainer').show();
                });
            });
            //cancel
            $('#cancel').click(function () {
                $('#addNewClient').removeAttr("disabled");
                $('#mainContentPlaceholder_newClientContainer').slideUp();
            });
            //close
            $('#close').click(function () {
                $('#mainContentPlaceholder_notificationContainer').fadeOut();
                $('#notificationContainer').fadeOut();
            });
        };
 
        function ResponseEnd(sender, eventArgs) {
            SetElements();
            Cufon.replace('h1');
            Cufon.replace('h2');
            Cufon.now();
        };
 
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainContentPlaceholder" runat="Server">
    <div id="leftContainer" runat="server">
        <h1>
            Clients
        </h1>
        <div id="notificationContainer" runat="server" visible="false">
            <asp:Literal ID="notificationLiteral" runat="server" /><span><a href="#" id="close"></a></span></div>
        <%--<uc1:Notifications ID="notifications" runat="server" />--%>
        <div id="navigation">
            <a id="addNewClient" href="#" class="button hex2C608F">Add New Client</a>
        </div>
        <div id="newClientContainer" class="extra-b5" runat="server">
            <table class="clientDetailsTable" cellspacing="0" cellpadding="0">
                <tr>
                    <td>
                        <h4 class="extra-b5">
                            Client Details</h4>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="clientNameLabel" runat="server" Text="Client Name" /><br />
                        <asp:TextBox ID="clientNameTextBox" runat="server" CssClass="textbox short" MaxLength="50" />
                        <asp:RequiredFieldValidator ID="clientNameRequiredValidator" runat="server" ErrorMessage="Please enter a client name."
                            Display="None" ControlToValidate="clientNameTextBox" ValidationGroup="newClientGroup" />
                    </td>
                    <td>
                        <asp:Label ID="themeLabel" runat="server" Text="Theme" /><br />
                        <asp:DropDownList ID="themeDropDownList" runat="server" AppendDataBoundItems="true"
                            CssClass="short">
                            <asp:ListItem Value="-1">-- Please Select --</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:Button ID="addClientButton" runat="server" Text="Add" OnClick="addClientButton_Click"
                            ValidationGroup="newClientGroup" />
                        or <a id="cancel" href="#">Cancel</a>
                    </td>
                </tr>
            </table>
            <asp:ValidationSummary ID="newClientValidationSummary" runat="server" ShowMessageBox="true"
                ShowSummary="false" ValidationGroup="newClientGroup" />
        </div>
        <asp:ListView ID="clientsListView" runat="server">
            <LayoutTemplate>
                <ul class="list1">
                    <div id="itemPlaceholder" runat="server" class="list1">
                    </div>
                </ul>
            </LayoutTemplate>
            <ItemTemplate>
                <li>
                    <%# Eval("Name") %><div class="options">
                        <a href="ClientDetails.aspx?ClientId=<%# Eval("Id") %>">Edit</a><span class="separator">|</span>
                        <asp:LinkButton ID="deleteClientLinkButton" runat="server" OnCommand="DeleteClient"
                            CommandArgument='<%# Eval("Id") %>' OnClientClick="return confirm('Are you sure you want to delete this client?')"
                            Text="Delete" />
                        <%--<a href="ManageClients.aspx?ClientId=<%# Eval("Id") %>" onclick="return confirm('Are you sure you want to delete this client?')">Delete</a></div>--%>
                </li>
            </ItemTemplate>
        </asp:ListView>
    </div>
    <div id="rightContainer" runat="server">
        <h1>
            Placeholder
        </h1>
        <h4 class="extra-b12">
            Integer in metus sapien.</h4>
        <p>
            Praesent diam tellus, congue nec pellentesque dictum, convallis non dui. Nam tincidunt
            tempor lectus quis placerat. Pellentesque habitant morbi tristique senectus et netus
            et malesuada fames ac turpis egestas. Proin condimentum posuere nisl, ut mollis
            metus mollis at.</p>
        <p>
            Integer in metus sapien. Maecenas aliquet porttitor nisl, a rhoncus ligula pellentesque
            at. Maecenas tempor odio ut dolor pharetra faucibus. Cras in massa a odio vulputate
            ultricies ac non purus. Etiam in orci nibh, quis dictum ante. In hac habitasse platea
            dictumst.</p>
    </div>
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="addClientButton">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="leftContainer" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="deleteClientLinkButton">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="leftContainer" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
    <telerik:RadAjaxLoadingPanel ID="radAjaxLoadingPanel" runat="server" Skin="Vista">
    </telerik:RadAjaxLoadingPanel>
</asp:Content>
Roger
Top achievements
Rank 1
 answered on 18 Oct 2016
1 answer
106 views

Dynamically Generated Radgrid with Form Template loses Dynamic Binding on Edit Click.

 

I have a RadGrid that gets Created and Bound Dynamically. But when I click edit it rebinds the grid then when I hit update it rebinds the grid and loses the datasource and so It has to call NeedDataSource again which blows away the new values before it gets to the update command.

Jerald
Top achievements
Rank 1
 answered on 18 Oct 2016
4 answers
613 views
How can I convert the date time to localtime in GridDateTimeColumn?  On ASP.net grid control, I used itemtemplate then convert the datetime field to local time using "ToLocalTime()" but I don't know how to do it in GridDateTimeColumn.                    

Thanks
Tom
Dan
Top achievements
Rank 1
 answered on 18 Oct 2016
2 answers
79 views

Hi,

We are trying to create a mobile view of some forms which use Telerik controls for some elements, namely RadInput and RadInputMulti. All other form fields save when the form is posted back on mobile except for the Telerik based fields. When the page is posted back we are seeing a javascript error that reads 'Uncaught TypeError: Cannot read property 'PageRequestManager' of undefined', coming ScriptResource.axd at line 106. 

Is there an issue with using these fields on mobile, and if so is there anything we can do to mitigate this issue and make things work?

We are using version 2015.2.818.35 of the Telerik controls, on a SharePoint 2010 platform.

Testing is happening in Chrome and Safari for iOS, although the solution needs to work on Android as well.

Thanks for any help in advance.

Ben

Ben
Top achievements
Rank 1
 answered on 18 Oct 2016
3 answers
349 views

Hi,

I am using RadTabstrip and Raddropdownlist.

 

Whenever the RadTabstrip is selected, the values selected in dropdownlist should be cleared, but i notice whenever i use the  categoryList.get_selectedItem().unselect(); it causes to postback. How to cancel the post back ?

 

I am using this code below

 

 <script type="text/javascript">
function OnClientTabSelected(sender, eventArgs)
{
    var tab = eventArgs.get_tab();    
    var categoryList = $find("<%=rdddlCategory.ClientID %>");   
    if (categoryList.get_selectedItem()) {      
        //categoryList.get_selectedItem().set_selected(false);
        categoryList.get_selectedItem().unselect();
       
    }
}

        function OnClientCategorySelected(sender, eventArgs) {
            alert();
            var tabstrip = $find('<%= rdTpEvents.ClientID %>');            
            if (tabstrip.get_selectedTab().get_text() != "Latest" && tabstrip.get_selectedTab().get_text() != "Working") {              
                eventArgs.set_cancel(true);
            }
        }

</script>

Ivan Danchev
Telerik team
 answered on 18 Oct 2016
3 answers
335 views

Hello,

I'm looking for a functionality through which i can do virus scan during upload file

I want to do virus scan of uploadable file during upload on disk using RadAsyncUpload functionality.

how can i add virus scan on telerik async file upload.

Please suggest some code I'm using RadAsyncUpload.

 

Thanks & regards,

Ram

Rumen
Telerik team
 answered on 18 Oct 2016
4 answers
1.1K+ views
user will select date and other option (by radcombobbox) and then click "Search" button to show the result in radgrid.but user input text for filter or click the header to sort, the grid will disappear.

user need to click the "Search" button again to show the result. how can i solve it ? thanks.

the code as follows:


<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="false" PageSize="300" AllowMultiRowSelection="true"
CssClass="radgrid" AllowFilteringByColumn="true" AutoGenerateColumns="false"
GridLines="None" CellSpacing="0" Visible="true" EnableLinqExpressions="false">
<ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="false">
<Selecting AllowRowSelect="True" />
</ClientSettings>
<MasterTableView DataKeyNames="id">

<Columns>

<telerik:GridTemplateColumn UniqueName="RowNo" HeaderText="No." AllowFiltering="false">
<ItemTemplate>
<%# (Container.ItemIndex+1).ToString() %>
</ItemTemplate>
<HeaderStyle Width="30px" />
</telerik:GridTemplateColumn>

<telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" Visible="true" >
</telerik:GridClientSelectColumn>

<telerik:GridEditCommandColumn UniqueName="EditCommandColumn" HeaderStyle-Width="50" ItemStyle-ForeColor="Blue" Visible="true">
</telerik:GridEditCommandColumn>

<telerik:GridBoundColumn DataField="DisplayName" ShowFilterIcon="true" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
FilterControlAltText="Filter DisplayName column" HeaderText="DisplayName"
SortExpression="DisplayName" UniqueName="DisplayName" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Job_Title" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="true"
FilterControlAltText="Filter Job_Title column" HeaderText="Job_Title"
SortExpression="Job_Title" UniqueName="Job_Title">
</telerik:GridBoundColumn>

XXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXX

</Columns>
</mastertableview>
<FilterMenu EnableImageSprites="False"></FilterMenu>
</telerik:RadGrid>

Code behind as follows:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Server.ScriptTimeout = 1200

End Sub


Protected Sub btn_Search_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn_Search.Click

LoadSearchResult()

End Sub


Private Sub LoadSearchResult()

Dim dc As New dcDataContext

'get level3 of radcombobox
Dim strCOM_cmb As String = ""

For i = 0 To df_location_lv3.CheckedItems.Count - 1
If df_location_lv3.CheckedItems(i).Checked = True Then
strCOM_cmb += df_location_lv3.CheckedItems(i).Value.ToString & ","
End If
Next
If Left(strCOM_cmb, 1) = "," Then
strCOM_cmb = Right(strCOM_cmb, Len(strCOM_cmb) - 1)
End If
If Right(strCOM_cmb, 1) = "," Then
strCOM_cmb = Left(strCOM_cmb, Len(strCOM_cmb) - 1)
End If
strCOM_cmb = TrimList(strCOM_cmb)

Dim listCOM_cmb = Split(strCOM_cmb, ",")


Dim txt_name_from As String = "A"
Dim txt_name_to As String = "Z"

If txt_displayname_start_from.Text <> String.Empty Then
txt_name_from = txt_displayname_start_from.Text.ToLower.Trim
End If

If txt_displayname_start_to.Text <> String.Empty Then
txt_name_to = txt_displayname_start_to.Text.ToLower.Trim
End If


Dim rec = (From a In dc.TmpDB_LMS _
Where a.EmailDate Is Nothing _
And a.Level2Desc = df_location_lv2.SelectedValue _
And listCOM_cmb.Contains(a.Level3Desc) _
And a.StartDate = CType(df_start_date.SelectedValue, Date) _
And a.DisplayName.ToLower().Substring(0, txt_name_from.Length).CompareTo(txt_name_from.ToLower()) >= 0 AndAlso a.DisplayName.ToLower().Substring(0, txt_name_to.Length).CompareTo(txt_name_to.ToLower()) <= 0 _
Order By a.DisplayName _
).ToList


RadGrid1.DataSource = Nothing
RadGrid1.DataSource = rec
RadGrid1.DataBind()

End Sub


raja
Top achievements
Rank 1
 answered on 18 Oct 2016
1 answer
73 views

I have a RadToolBar in the CommandItemTemplate of a RadGrid.  I would like to (client-side) disable a button upon row click.  On row click I loop through the tool bar's items and disable the button I want.  This works but only disables the button on the top of the grid.  The command items at the bottom of the grid are left alone.  How can I disable both the top and bottom button?

 

function grdViewToolRecords_RowClicked(sender, args) {
    var toolBar = $telerik.findControl(sender.get_element(), "rtbViewToolRecords");
    var toolBarItems = toolBar.get_allItems();
 
    var i = 0;
 
    while (i < toolBarItems.length) {
        if (toolBarItems[i].get_text() == "Check Out") {
            toolBarItems[i].disable();
        }
 
        i++;
    }
 
    toolBar.commitChanges();
}
Eyup
Telerik team
 answered on 18 Oct 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?